git.samba.org
/
cifs-utils.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cb3dc2f
)
Zero fill the allocated memory for new `struct cifs_ntsd`
author
misku
<miskuu@gmail.com>
Wed, 31 Jul 2019 11:12:24 +0000
(13:12 +0200)
committer
Pavel Shilovsky
<pshilov@microsoft.com>
Wed, 7 Aug 2019 21:52:26 +0000
(14:52 -0700)
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
patch
|
blob
|
history
diff --git
a/setcifsacl.c
b/setcifsacl.c
index da1d7425d74f38327e2e2d102d92fe258c396c39..f3d01894c1b54b81311dbbefef8d4b0b325f8cd5 100644
(file)
--- 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;