[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha7-2055-gc110e66

Stefan Metzmacher metze at samba.org
Fri Jun 5 13:53:00 GMT 2009


The branch, master has been updated
       via  c110e664af9449e8fac24f4ed6e973d98d4fd268 (commit)
      from  613c8acbdd93210b40ec6fa48cbbf297a061b3cc (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit c110e664af9449e8fac24f4ed6e973d98d4fd268
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Jun 5 15:41:46 2009 +0200

    nss_wrapper: fix segfault in nwrap_gr_copy_r()
    
    metze

-----------------------------------------------------------------------

Summary of changes:
 lib/nss_wrapper/nss_wrapper.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/nss_wrapper/nss_wrapper.c b/lib/nss_wrapper/nss_wrapper.c
index 7b67e69..317c251 100644
--- a/lib/nss_wrapper/nss_wrapper.c
+++ b/lib/nss_wrapper/nss_wrapper.c
@@ -816,7 +816,7 @@ static int nwrap_gr_copy_r(const struct group *src, struct group *dst,
 {
 	char *first;
 	char **lastm;
-	char *last;
+	char *last = NULL;
 	off_t ofsb;
 	off_t ofsm;
 	off_t ofs;
@@ -825,9 +825,14 @@ static int nwrap_gr_copy_r(const struct group *src, struct group *dst,
 	first = src->gr_name;
 
 	lastm = src->gr_mem;
-	while (*lastm) lastm++;
+	while (*lastm) {
+		last = *lastm;
+		lastm++;
+	}
 
-	last = *lastm;
+	if (last == NULL) {
+		last = src->gr_passwd;
+	}
 	while (*last) last++;
 
 	ofsb = PTR_DIFF(last + 1, first);


-- 
Samba Shared Repository


More information about the samba-cvs mailing list