cifs-utils/0009-Zero-fill-the-allocated-memory-for-new-struct-cifs_n.patch
Paulo Alcantara 9f24f9e262 Accepting request 723800 from home:aaptel:cifs-utils-6.9
- add for-next changes, update changelog date
  * add 0001-smbinfo-Improve-help-usage-and-add-h-option.patch
  * add 0002-smbinfo-Add-bash-completion-support-for-smbinfo.patch
  * add 0003-getcifsacl-Add-support-to-accept-more-paths.patch
  * add 0004-getcifsacl-Fix-usage-message-to-include-multiple-fil.patch
  * add 0005-smbinfo-add-GETCOMPRESSION-support.patch
  * add 0006-getcifsacl-Add-support-for-R-recursive-option.patch
  * add 0007-smbinfo-add-bash-completion-support-for-getcompressi.patch
  * add 0008-mount.cifs.c-fix-memory-leaks-in-main-func.patch
  * add 0009-Zero-fill-the-allocated-memory-for-new-struct-cifs_n.patch
  * add 0010-Zero-fill-the-allocated-memory-for-a-new-ACE.patch

OBS-URL: https://build.opensuse.org/request/show/723800
OBS-URL: https://build.opensuse.org/package/show/network:samba:STABLE/cifs-utils?expand=0&rev=172
2019-08-15 21:02:09 +00:00

28 lines
853 B
Diff

From 5a468f3dcbea4bfbc380a3f86466b8e33bc40570 Mon Sep 17 00:00:00 2001
From: misku <miskuu@gmail.com>
Date: Wed, 31 Jul 2019 13:12:24 +0200
Subject: [PATCH] Zero fill the allocated memory for new `struct cifs_ntsd`
Fixes a bug where `sacloffset` may not be set at all later on and therefore it
can contain the original memory contents == trash.
---
setcifsacl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/setcifsacl.c b/setcifsacl.c
index da1d742..f3d0189 100644
--- a/setcifsacl.c
+++ b/setcifsacl.c
@@ -206,7 +206,7 @@ alloc_sec_desc(struct cifs_ntsd *pntsd, struct cifs_ntsd **npntsd,
acessize = aces * sizeof(struct cifs_ace);
bufsize = size + acessize;
- *npntsd = malloc(bufsize);
+ *npntsd = calloc(1, bufsize);
if (!*npntsd) {
printf("%s: Memory allocation failure", __func__);
return errno;
--
2.16.4