diff options
author | Bernd Schubert <bschubert@ddn.com> | 2024-04-06 15:19:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-06 15:19:33 +0200 |
commit | 20de66dc898002b9315192a5095a3dcd4f6ec248 (patch) | |
tree | a5f1ac7d72df07d135586ec04222f422d8543995 /util | |
parent | e2df577a7ca0c4b06d9eb36eb79138e34cc03088 (diff) | |
download | libfuse-20de66dc898002b9315192a5095a3dcd4f6ec248.tar.gz |
fusermount: Fix use of uninitialized x_mnt_opts (#924)
x_mnt_opts was not initialized to 0, but strncat was done
Spotted by cppcheck running on our ddn branch.
Diffstat (limited to 'util')
-rw-r--r-- | util/fusermount.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/util/fusermount.c b/util/fusermount.c index 5716c76..a031763 100644 --- a/util/fusermount.c +++ b/util/fusermount.c @@ -1255,7 +1255,7 @@ static int mount_fuse(const char *mnt, const char *opts, const char **type) size_t mnt_opts_len = strlen(mnt_opts); size_t x_mnt_opts_len = mnt_opts_len+ strlen(x_opts) + 2; - char *x_mnt_opts = malloc(x_mnt_opts_len); + char *x_mnt_opts = calloc(1, x_mnt_opts_len); if (mnt_opts_len) { strcpy(x_mnt_opts, mnt_opts); |