From: Simon Wilkinson Date: Sat, 2 Mar 2013 11:02:09 +0000 (+0000) Subject: libadmin: Don't free garbage pointer X-Git-Tag: upstream/1.6.10_pre1^2~142 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=a78e3a7e673d5d0428e769a8a9f0ea1ccb683d40;p=packages%2Fo%2Fopenafs.git libadmin: Don't free garbage pointer If we jump to the error handler early on in pts_GroupOwnerChange, idlist may not have been used, and so we will end up trying to free stack garbage. Initialise the structure to 0 at the start of the function, so it is always safe to enter the error handler. Caught by coverity (#985962) Reviewed-on: http://gerrit.openafs.org/9398 Tested-by: BuildBot Reviewed-by: Derrick Brashear Reviewed-by: Jeffrey Altman (cherry picked from commit 8260d86dda766a21e9f457994e7a3b259ba3a31b) Change-Id: I79f7fe3cba11a2904c644e6747511e3630d74a79 Reviewed-on: http://gerrit.openafs.org/11047 Reviewed-by: Andrew Deason Tested-by: BuildBot Reviewed-by: Chas Williams - CONTRACTOR Reviewed-by: Stephan Wiesand --- diff --git a/src/libadmin/pts/afs_ptsAdmin.c b/src/libadmin/pts/afs_ptsAdmin.c index c74e89713..05bf37607 100644 --- a/src/libadmin/pts/afs_ptsAdmin.c +++ b/src/libadmin/pts/afs_ptsAdmin.c @@ -465,6 +465,8 @@ pts_GroupOwnerChange(const void *cellHandle, const char *targetGroup, afs_cell_handle_p c_handle = (afs_cell_handle_p) cellHandle; idlist ids; + memset(&ids, 0, sizeof(ids)); + /* * Validate arguments */