summaryrefslogtreecommitdiff
path: root/source3/lib/system.c
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1999-07-16 22:07:37 +0000
committerLuke Leighton <lkcl@samba.org>1999-07-16 22:07:37 +0000
commit65930413f4b0350dece7615136c3e2b83edeaf1a (patch)
tree62ccf382c32be1588ddeb19e0b434e432f26a52a /source3/lib/system.c
parent0262b2a6b49d3a2418e3f335f06cbb227382bc86 (diff)
downloadsamba-65930413f4b0350dece7615136c3e2b83edeaf1a.tar.gz
samba-65930413f4b0350dece7615136c3e2b83edeaf1a.tar.bz2
samba-65930413f4b0350dece7615136c3e2b83edeaf1a.zip
check to see if copy_passwd_struct() ever receives its own internal
buffer as an argument :-) :-) (This used to be commit 0d1f5e5a6d1cbceda3be3d5626842116e6e91809)
Diffstat (limited to 'source3/lib/system.c')
-rw-r--r--source3/lib/system.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source3/lib/system.c b/source3/lib/system.c
index 0bd1fea140..5a5f853bda 100644
--- a/source3/lib/system.c
+++ b/source3/lib/system.c
@@ -557,6 +557,13 @@ struct passwd *copy_passwd_struct(struct passwd *pass)
return NULL;
}
+ if (pass == &pw_ret)
+ {
+ /* catch silly error where buffer was already copied */
+ DEBUG(0,("copy_passwd_struct: can't copy internal buffer!\n"));
+ return NULL;
+ }
+
memcpy((char *)&pw_ret, pass, sizeof(struct passwd));
if (pass->pw_name)