diff options
author | Jim Meyering <meyering@redhat.com> | 2012-07-09 22:50:09 +0200 |
---|---|---|
committer | Anand Avati <avati@redhat.com> | 2012-07-11 19:17:19 -0700 |
commit | a8ce48126dc57726f820e8815cff8b24911ca076 (patch) | |
tree | 62537644d8847a7913727ce74b802bb7c8ad4f5f /glusterfs-hadoop | |
parent | 7c88fcd63df71cc1b81caea791235a828c9b419e (diff) |
cli: print_brick_status: don't smash stack
For bricklen > 110 (i.e., 2 * fieldlen), the if-clause
would be executed 2 or more times, making strncpy write
past the end of "buf", clobbering the stack. Rewrite,
removing unnecessary use of strncpy, strlen and decl/use
of the temporary buffer, and instead, specifying precision
via a printf-style format directive.
Coverity identified the static buffer overrun.
Change-Id: I176386e752c397dea22265de9f3c6eb631334f4f
BUG: 789278
Signed-off-by: Jim Meyering <meyering@redhat.com>
Reviewed-on: http://review.gluster.com/3646
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'glusterfs-hadoop')
0 files changed, 0 insertions, 0 deletions