summaryrefslogtreecommitdiffstats
path: root/source/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
commit0d1f5e5a6d1cbceda3be3d5626842116e6e91809 (patch)
treea74c627ab3380bbfd547e0b05b13b12ea01bf031 /source/lib/system.c
parent93298bca1c573532c5250c84bac39cf9214ba3b5 (diff)
downloadsamba-0d1f5e5a6d1cbceda3be3d5626842116e6e91809.tar.gz
samba-0d1f5e5a6d1cbceda3be3d5626842116e6e91809.tar.xz
samba-0d1f5e5a6d1cbceda3be3d5626842116e6e91809.zip
check to see if copy_passwd_struct() ever receives its own internal
buffer as an argument :-) :-)
Diffstat (limited to 'source/lib/system.c')
-rw-r--r--source/lib/system.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/lib/system.c b/source/lib/system.c
index 0bd1fea1408..5a5f853bda8 100644
--- a/source/lib/system.c
+++ b/source/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)