From 65930413f4b0350dece7615136c3e2b83edeaf1a Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Fri, 16 Jul 1999 22:07:37 +0000 Subject: check to see if copy_passwd_struct() ever receives its own internal buffer as an argument :-) :-) (This used to be commit 0d1f5e5a6d1cbceda3be3d5626842116e6e91809) --- source3/lib/system.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source3/lib') 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) -- cgit