]> git.michaelhowe.org Git - packages/o/openafs.git/commit
Fix segmentation fault in vsu_GetVolumeID
authorAntoine Verheijen <antoine@ualberta.ca>
Mon, 8 Feb 2010 23:01:46 +0000 (16:01 -0700)
committerDerrick Brashear <shadow|account-1000005@unknown>
Tue, 9 Feb 2010 03:45:29 +0000 (19:45 -0800)
commitffbda5616640f81278d283d237c642304ed1412e
tree50657ce64c1bbb7c797cc41c2c816f109b71ee4d
parent19e38017671a9acadb77a15f224edf77fb8efbac
Fix segmentation fault in vsu_GetVolumeID

When determining the volume type of a volume, vsu_GetVolumeID() checks
to see if the volume name ends in '.backup' or '.readonly' by backing
up the appropriate number of characters from the end of the name. It
does not, however, check to see if it skips past the beginning of the
volume name. This can result in a segmentation fault (which it has for
me on many occasions during a vos release) depending on where memory
is allocated or how/if memory is protected.

This patch corrects this behaviour by checking the volume name string
length prior to doing the string comparison.

Change-Id: Ia27fcac76b86ae2707663caa6bff365a4e8dd0da
Reviewed-on: http://gerrit.openafs.org/1269
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 4221d7acc8595a052dbc5fbb4366050c00d6ef37)
Reviewed-on: http://gerrit.openafs.org/1270
src/volser/vsutils.c