git.samba.org
/
kai
/
samba-autobuild
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
613c8ac
)
nss_wrapper: fix segfault in nwrap_gr_copy_r()
author
Stefan Metzmacher
<metze@samba.org>
Fri, 5 Jun 2009 13:41:46 +0000
(15:41 +0200)
committer
Stefan Metzmacher
<metze@samba.org>
Fri, 5 Jun 2009 13:52:20 +0000
(15:52 +0200)
metze
lib/nss_wrapper/nss_wrapper.c
patch
|
blob
|
history
diff --git
a/lib/nss_wrapper/nss_wrapper.c
b/lib/nss_wrapper/nss_wrapper.c
index 7b67e695d65a6dcef6a4946152d07878508fda0a..317c251a24b296044e91fe6fb84ded800fa1e21a 100644
(file)
--- 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);