OpenAFS Master Repository branch, master, updated. BP--openafs-stable-1_6_x-1218-gb6add11
Gerrit Code Review
Wed, 1 Jun 2011 06:14:26 -0700 (PDT)
The following commit has been merged in the master branch:
Author: Simon Wilkinson <email@example.com>
Date: Tue May 31 08:28:51 2011 +0100
vos: Don't leak/overflow bulkaddrs
The vos listaddrs command repeatedly reuses a bulkaddrs array. It
zeros it once (without freeing the allocated memory), and then
repeatedly uses it without zeroing in a loop. This means that the XDR
library assumes that a sufficiently large block is already allocated,
doesn't reallocate for the incoming data, or check limits.
This means that if the first call to VL_GetAddrsU returns a set of
addresses smaller than subsequent calls, we'll write past the end
of the array, causing memory corruption.
Fix this by freeing the arrays correctly with each pass of the call.
Reviewed-by: Jeffrey Altman <firstname.lastname@example.org>
Tested-by: BuildBot <email@example.com>
Reviewed-by: Derrick Brashear <firstname.lastname@example.org>
src/volser/vos.c | 21 +++++++++++----------
1 files changed, 11 insertions(+), 10 deletions(-)
OpenAFS Master Repository