diff options
author | Amar Tumballi <amarts@redhat.com> | 2018-11-06 22:47:41 +0530 |
---|---|---|
committer | Shyamsundar Ranganathan <srangana@redhat.com> | 2018-11-09 14:03:02 +0000 |
commit | 83304fedb464fe3f97db662ce3e07bd948b7b7d9 (patch) | |
tree | e9bc09af05900b562a99bff6ff964ed19a9bf685 /xlators/mount/fuse/src/fuse-bridge.c | |
parent | 7136414bcc0426270f1df8720018af1b53fd228a (diff) |
all: fix the format string exceptions
Currently, there are possibilities in few places, where a user-controlled
(like filename, program parameter etc) string can be passed as 'fmt' for
printf(), which can lead to segfault, if the user's string contains '%s',
'%d' in it.
While fixing it, makes sense to make the explicit check for such issues
across the codebase, by making the format call properly.
Fixes: CVE-2018-14661
Fixes: bz#1647666
Change-Id: Ib547293f2d9eb618594cbff0df3b9c800e88bde4
Signed-off-by: Amar Tumballi <amarts@redhat.com>
Diffstat (limited to 'xlators/mount/fuse/src/fuse-bridge.c')
-rw-r--r-- | xlators/mount/fuse/src/fuse-bridge.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c index 5e208f36175..efb390a9c54 100644 --- a/xlators/mount/fuse/src/fuse-bridge.c +++ b/xlators/mount/fuse/src/fuse-bridge.c @@ -5177,7 +5177,7 @@ fuse_priv_dump(xlator_t *this) gf_proc_dump_write("proto_minor", "%u", private->proto_minor); gf_proc_dump_write("volfile", "%s", private->volfile ? private->volfile : "None"); - gf_proc_dump_write("volfile_size", "%d", private->volfile_size); + gf_proc_dump_write("volfile_size", "%" GF_PRI_SIZET, private->volfile_size); gf_proc_dump_write("mount_point", "%s", private->mount_point); gf_proc_dump_write("fuse_thread_started", "%d", (int)private->fuse_thread_started); @@ -5211,7 +5211,7 @@ fuse_history_dump(xlator_t *this) GF_VALIDATE_OR_GOTO(this->name, this->history, out); gf_proc_dump_build_key(key_prefix, "xlator.mount.fuse", "history"); - gf_proc_dump_add_section(key_prefix); + gf_proc_dump_add_section("%s", key_prefix); eh_dump(this->history, NULL, dump_history_fuse); ret = 0; @@ -5232,7 +5232,7 @@ dump_history_fuse(circular_buffer_t *cb, void *data) ".%" GF_PRI_SUSECONDS, cb->tv.tv_usec); gf_proc_dump_write("TIME", "%s", timestr); - gf_proc_dump_write("message", "%s\n", cb->data); + gf_proc_dump_write("message", "%s\n", (char *)cb->data); return 0; } |