[fedfs-utils] [PATCH 2/8] fedfsd: don't return freed memory through **pathname parameter, ...

Jim Meyering jim at meyering.net
Wed Nov 30 12:51:32 PST 2011


From: Jim Meyering <meyering at redhat.com>

even though upon error it will not be used.
* src/fedfsd/svc.c (fedfsd_pathwalk): On an error path, don't
set *pathname at all, and certainly not to a just-freed pointer.

mount avoid one-byte heap-write overrun
---
 src/fedfsd/svc.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/src/fedfsd/svc.c b/src/fedfsd/svc.c
index 132be70..3509082 100644
--- a/src/fedfsd/svc.c
+++ b/src/fedfsd/svc.c
@@ -318,7 +318,6 @@ fedfsd_pathwalk(const FedFsPathName fpath, char **pathname)
 		retval = fedfsd_pathwalk_check_term(result);
 		if (retval != FEDFS_OK)
 			free(result);
-		*pathname = result;
 		return retval;
 	}

-- 
1.7.8.rc4




More information about the fedfs-utils-devel mailing list