projects
/
qemu-gpiodev
/
libfuse.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e2df577
)
fusermount: Fix use of uninitialized x_mnt_opts (#924)
author
Bernd Schubert
<bschubert@ddn.com>
Sat, 6 Apr 2024 13:19:33 +0000
(15:19 +0200)
committer
GitHub
<noreply@github.com>
Sat, 6 Apr 2024 13:19:33 +0000
(15:19 +0200)
x_mnt_opts was not initialized to 0, but strncat was done
Spotted by cppcheck running on our ddn branch.
util/fusermount.c
patch
|
blob
|
history
diff --git
a/util/fusermount.c
b/util/fusermount.c
index 5716c76990a086c0d87a1f970b215f011774e404..a03176355110ae8c6e3dc5f295b7a7f41ea73ea3 100644
(file)
--- 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);