summaryrefslogtreecommitdiff
path: root/libc
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2002-11-15 09:25:16 +0000
committerEric Andersen <andersen@codepoet.org>2002-11-15 09:25:16 +0000
commit944d7f249baa4a3661f138fd61e0a5e1fe3b1dd8 (patch)
treef7d458ac59aeb7f020376af18662c41891cb689b /libc
parentbb9393fa99f96a086572d2332e6ac8283b8fe954 (diff)
Patch from Luc Van Oostenryck to fix a buffer overflow
in getlogin_r
Diffstat (limited to 'libc')
-rw-r--r--libc/unistd/getlogin.c2
1 files changed, 1 insertions, 1 deletions
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;
}