diff --git a/patches/02-ACL_Extended_Attributes/0011-server-Add-additional-checks-in-get_xattr_sd-to-prev.patch b/patches/02-ACL_Extended_Attributes/0011-server-Add-additional-checks-in-get_xattr_sd-to-prev.patch index 3b09988d..084f5187 100644 --- a/patches/02-ACL_Extended_Attributes/0011-server-Add-additional-checks-in-get_xattr_sd-to-prev.patch +++ b/patches/02-ACL_Extended_Attributes/0011-server-Add-additional-checks-in-get_xattr_sd-to-prev.patch @@ -1,18 +1,18 @@ -From f3596dd4a6dd481e67ff2c0e72aa5c4c74b1be72 Mon Sep 17 00:00:00 2001 +From 8abcd1aac3f65585dfb2e761dd737c0609cd5f93 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Sun, 1 Jun 2014 23:46:09 +0200 Subject: server: Add additional checks in get_xattr_sd to prevent crashes caused by invalid attributes. --- - server/file.c | 8 +++++++- - 1 file changed, 7 insertions(+), 1 deletion(-) + server/file.c | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/server/file.c b/server/file.c -index 08231a7..d5d5ad4 100644 +index 08231a7..11522c3 100644 --- a/server/file.c +++ b/server/file.c -@@ -738,10 +738,16 @@ struct security_descriptor *get_xattr_sd( int fd ) +@@ -738,12 +738,18 @@ struct security_descriptor *get_xattr_sd( int fd ) int n; n = fgetxattr( fd, "user.wine.sd", buffer, sizeof(buffer) ); @@ -28,8 +28,11 @@ index 08231a7..d5d5ad4 100644 + return NULL; + sd = mem_alloc( n - 2 ); - memcpy( sd, &buffer[2], n - 2 ); +- memcpy( sd, &buffer[2], n - 2 ); ++ if (sd) memcpy( sd, &buffer[2], n - 2 ); return sd; + #else + return NULL; -- 1.7.9.5