From 944d7f249baa4a3661f138fd61e0a5e1fe3b1dd8 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Fri, 15 Nov 2002 09:25:16 +0000 Subject: Patch from Luc Van Oostenryck to fix a buffer overflow in getlogin_r --- libc/unistd/getlogin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libc') diff --git a/libc/unistd/getlogin.c b/libc/unistd/getlogin.c index c762c366e..6db73ae1c 100644 --- a/libc/unistd/getlogin.c +++ b/libc/unistd/getlogin.c @@ -42,7 +42,7 @@ int getlogin_r(char *name, size_t len) return -1; strncpy(name, foo, len); - name[len] = '\0'; + name[len-1] = '\0'; return 0; } -- cgit v1.2.3