[Bugs] [Bug 1193929] GlusterFS can be improved

bugzilla at redhat.com bugzilla at redhat.com
Tue Aug 21 10:50:59 UTC 2018


https://bugzilla.redhat.com/show_bug.cgi?id=1193929



--- Comment #200 from Worker Ant <bugzilla-bot at gluster.org> ---
COMMIT: https://review.gluster.org/20744 committed in master by "Amar Tumballi"
<amarts at redhat.com> with a commit message- glusterd: fix gcc warnings

...and also changed char array initialization to from {0,} to "".

gcc version 8.1.1 20180712 (Red Hat 8.1.1-5) (GCC) on Fedora 28.

Sample warnings:
glusterd-utils.c:7234:41: warning: ‘.hostname’ directive output may be
truncated writing 9 bytes into a region of size between 1 and 1024
[-Wformat-truncation=]
         snprintf (key, sizeof (key), "%s.hostname", base_key);
                                         ^~~~~~~~~
glusterd-utils.c:7234:9: note: ‘snprintf’ output between 10 and 1033 bytes into
a destination of size 1024
         snprintf (key, sizeof (key), "%s.hostname", base_key);
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

glusterd-snapshot.c:3090:65: warning: ‘/’ directive output may be truncated
writing 1 byte into a region of size between 0 and 4095 [-Wformat-truncation=]
                 snprintf (snap_path, sizeof (snap_path) - 1, "%s/%s",
                                                                 ^
glusterd-snapshot.c:3090:17: note: ‘snprintf’ output between 2 and 4351 bytes
into a destination of size 4095
                 snprintf (snap_path, sizeof (snap_path) - 1, "%s/%s",
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                           snap_mount_dir, snap_vol->snapshot->snapname);
                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

glusterd-statedump.c:28:45: warning: ‘%s’ directive output may be truncated
writing up to 4095 bytes into a region of size 144 [-Wformat-truncation=]
         snprintf (subkey, sizeof (subkey), "%s%d", key, index);
                                             ^~     ~~~
glusterd-statedump.c:28:9: note: ‘snprintf’ output between 2 and 4107 bytes
into a destination of size 144
         snprintf (subkey, sizeof (subkey), "%s%d", key, index);
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

updates: bz#1193929
Change-Id: Ic721f27b28d1221c124b570e81c55528f5b7f3cd
Signed-off-by: Ravishankar N <ravishankar at redhat.com>

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are the assignee for the bug.


More information about the Bugs mailing list