summaryrefslogtreecommitdiffstats
path: root/glusterfsd
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2012-07-03 17:06:46 +0200
committerAnand Avati <avati@redhat.com>2012-07-12 00:27:15 -0700
commitc76b49047aa396c0296a6ba2120e14abc0d27491 (patch)
tree11b2a48b5ffb430f473a194feeb399f768c9d257 /glusterfsd
parentee480749ee61af01b18ddb37e80a73153c7de92e (diff)
geo-rep: don't let unexpected status provoke undefined behavior
glusterd_gsync_read_frm_status reads what is expected to be a NUL- terminated status string from the specified file, but makes two mistakes when trying to do the favor of trimming trailing spaces. Do not let a leading NUL byte of status cause us to read buf[-1] and possibly to clear that and any preceding "trailing" spaces. Do not let a blen-byte input (with no NUL byte) cause our use of strlen to access beyond the end of non-NUL-terminated buffer. I looked at this code because coverity reported that it was assuming a read-provided buffer to be NUL-terminated. Change-Id: I140be0948e31196e5be08766d4e6400bf6f4dfa1 BUG: 789278 Signed-off-by: Jim Meyering <meyering@redhat.com> Reviewed-on: http://review.gluster.com/3647 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'glusterfsd')
0 files changed, 0 insertions, 0 deletions