diff options
author | misku <miskuu@gmail.com> | 2019-07-31 13:12:24 +0200 |
---|---|---|
committer | Pavel Shilovsky <pshilov@microsoft.com> | 2019-08-07 14:52:26 -0700 |
commit | 5a468f3dcbea4bfbc380a3f86466b8e33bc40570 (patch) | |
tree | 81061d56915eb0c97d8306f5583d1ec4b25abebd | |
parent | cb3dc2fe88f6179011acbafaaed025c5bdc96131 (diff) | |
download | cifs-utils-5a468f3dcbea4bfbc380a3f86466b8e33bc40570.tar.gz cifs-utils-5a468f3dcbea4bfbc380a3f86466b8e33bc40570.tar.bz2 cifs-utils-5a468f3dcbea4bfbc380a3f86466b8e33bc40570.zip |
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.
-rw-r--r-- | setcifsacl.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; |