From 8260d86dda766a21e9f457994e7a3b259ba3a31b Mon Sep 17 00:00:00 2001 From: Simon Wilkinson Date: Sat, 2 Mar 2013 11:02:09 +0000 Subject: [PATCH] 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) Change-Id: If70102e3da07135a9ec695f13caebe6298eff8ca Reviewed-on: http://gerrit.openafs.org/9398 Tested-by: BuildBot Reviewed-by: Derrick Brashear Reviewed-by: Jeffrey Altman --- src/libadmin/pts/afs_ptsAdmin.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libadmin/pts/afs_ptsAdmin.c b/src/libadmin/pts/afs_ptsAdmin.c index 0e6a1bf8c7..845bab812c 100644 --- a/src/libadmin/pts/afs_ptsAdmin.c +++ b/src/libadmin/pts/afs_ptsAdmin.c @@ -468,6 +468,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 */