Ensure null termination of the password in mymachinepw, remove a debug
authorVolker Lendecke <vl@samba.org>
Wed, 4 Feb 2009 17:09:48 +0000 (18:09 +0100)
committerVolker Lendecke <vl@samba.org>
Wed, 4 Feb 2009 17:11:46 +0000 (18:11 +0100)
source3/auth/auth_netlogond.c

index a57f3b74a3662a0353acc62a181ee4ef29d24b2f..9191c751f37c8e33b485929ddf55c28653f9137a 100644 (file)
@@ -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';