diff options
author | Amar Tumballi <amarts@redhat.com> | 2018-11-01 07:25:25 +0530 |
---|---|---|
committer | Shyamsundar Ranganathan <srangana@redhat.com> | 2018-11-05 18:50:59 +0000 |
commit | 74e8328d3f6901d6ba38a313965fe910c8411324 (patch) | |
tree | 4816063d412cf9e436da301fccf165485bf22e18 /xlators/mount | |
parent | 2effe3b0d3fa51fc627c970353de2e326bcf1ef2 (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#1644763
Change-Id: Ib547293f2d9eb618594cbff0df3b9c800e88bde4
Signed-off-by: Amar Tumballi <amarts@redhat.com>
Diffstat (limited to 'xlators/mount')
-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 d34f77cb7c1..75b91a43fb1 100644 --- a/xlators/mount/fuse/src/fuse-bridge.c +++ b/xlators/mount/fuse/src/fuse-bridge.c @@ -5290,7 +5290,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); @@ -5324,7 +5324,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; @@ -5345,7 +5345,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; } |