summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormisku <miskuu@gmail.com>2019-07-31 13:11:18 +0200
committerPavel Shilovsky <pshilov@microsoft.com>2019-08-07 14:52:26 -0700
commitcb3dc2fe88f6179011acbafaaed025c5bdc96131 (patch)
tree1c2af47fe461f849bccaf0393567cf99d81d6853
parentbf7f48f4c7dcee623bd92b2e7a6ffd97a64a1138 (diff)
downloadcifs-utils-cb3dc2fe88f6179011acbafaaed025c5bdc96131.tar.gz
cifs-utils-cb3dc2fe88f6179011acbafaaed025c5bdc96131.tar.bz2
cifs-utils-cb3dc2fe88f6179011acbafaaed025c5bdc96131.zip
Zero fill the allocated memory for a new ACE
Fixes a bug inside a call to `verify_ace_flag`. When a flag string (char*) passed as a first parameter is "0x0", the final flag value (the second parameter - the value of a pointer to uint8_t) is not modified at all and contains the original memory contents == trash.
-rw-r--r--setcifsacl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/setcifsacl.c b/setcifsacl.c
index 1b98c37..da1d742 100644
--- a/setcifsacl.c
+++ b/setcifsacl.c
@@ -672,7 +672,7 @@ build_cmdline_aces(char **arrptr, int numcaces)
goto build_cmdline_aces_ret;
}
- cacesptr[i] = malloc(sizeof(struct cifs_ace));
+ cacesptr[i] = calloc(1, sizeof(struct cifs_ace));
if (!cacesptr[i]) {
printf("%s: ACE alloc error %d\n", __func__, errno);
goto build_cmdline_aces_ret;