From 8eb562a81db03bac3e4bb469eaa45e0969be924e Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Wed, 4 Feb 2009 18:09:48 +0100 Subject: Ensure null termination of the password in mymachinepw, remove a debug --- source3/auth/auth_netlogond.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/source3/auth/auth_netlogond.c b/source3/auth/auth_netlogond.c index a57f3b74a3..9191c751f3 100644 --- a/source3/auth/auth_netlogond.c +++ b/source3/auth/auth_netlogond.c @@ -134,8 +134,6 @@ static char *mymachinepw(TALLOC_CTX *mem_ctx) return NULL; } - pwd[sizeof(pwd)-1] = '\0'; - nread = read(fd, pwd, sizeof(pwd)-1); close(fd); @@ -144,7 +142,7 @@ static char *mymachinepw(TALLOC_CTX *mem_ctx) return NULL; } - DEBUG(0, ("pwd: %d [%s]\n", (int)nread, pwd)); + pwd[nread] = '\0'; if (pwd[nread-1] == '\n') { pwd[nread-1] = '\0'; -- cgit