diff options
author | Kaleb S KEITHLEY <kkeithle@redhat.com> | 2016-03-06 08:32:52 -0500 |
---|---|---|
committer | Jeff Darcy <jdarcy@redhat.com> | 2016-03-07 05:18:29 -0800 |
commit | 9c3fc4344a11f2b6d0a7906d45bc7a684d756839 (patch) | |
tree | 48cff7e56c43f210d03c88b4979dc5bbd6cf75a5 /tests/bugs/fuse | |
parent | 6860968c3adaf2e8c3cb51124bbdfccef74beeb9 (diff) |
ganesha: coverity fix in glusterd-ganesha.c
CID 1351698
Allocating buffer of size stat.st_size) to read lines from the file
without an overrrun feels like a bit of a hack. While it's extremely
unlikely that the file would ever be more than a thousand bytes long,
a) we don't want to use bad patterns (and set bad examples or
precedents for elsewhere in the source), and b) what if somehow the
file did become "large." We just don't want to ever risk allocating
huge amounts of memory by accident.
And all the superfluous logic to copy the resulting string? We have
gf_strdup() for that.
And a clean coverity. See following gerrit review comments for the URL.
Change-Id: I5860d6995d0eed06667fd2369df6be53ccff6ceb
Signed-off-by: Kaleb S KEITHLEY <kkeithle@redhat.com>
Reviewed-on: http://review.gluster.org/13614
Smoke: Gluster Build System <jenkins@build.gluster.com>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Diffstat (limited to 'tests/bugs/fuse')
0 files changed, 0 insertions, 0 deletions