summaryrefslogtreecommitdiffstats
path: root/support/include/xmalloc.h
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2012-05-01 15:26:54 -0400
committerSteve Dickson <steved@redhat.com>2012-05-01 15:30:00 -0400
commit4bcb8664cf44176a99fc2c4b92e7f28ee705a7d9 (patch)
tree0edeabf66321529595febd3abebfc1d0e08e4835 /support/include/xmalloc.h
parent8b50f9647aa4fd404e4cb70459c683eddc37f215 (diff)
downloadnfs-utils-4bcb8664cf44176a99fc2c4b92e7f28ee705a7d9.tar.gz
nfs-utils-4bcb8664cf44176a99fc2c4b92e7f28ee705a7d9.tar.xz
nfs-utils-4bcb8664cf44176a99fc2c4b92e7f28ee705a7d9.zip
v4_root_add_parents: remove a possible buffer overflow.
The loop in v4root_add_parents() is a little odd. The first time through, 'ptr' points immediately "beyond" a '/' character (the first). For every other iterration it points directly "at" a '/' character. Such inconsistency is error prone and infact there is an error. If "path" is precisely "/", then the first call to ptr = strchr(ptr, '/') will be given a 'ptr' which is beyond the '\0' at the end of "path". This could potentially contain anything and the strchr() could search well beyond a buffer (though this depends on exactly how the string is set up which depends on separate code). So change the loop to have 'ptr' always point at a '/', and handle the special case of "/" explicitly. Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'support/include/xmalloc.h')
0 files changed, 0 insertions, 0 deletions