void-packages/srcpkgs/shadow/patches/shadow-strncpy-usage.patch

24 lines
718 B
Diff
Raw Normal View History

2012-02-14 08:49:16 +01:00
--- src/usermod.c.orig 2012-02-13 08:19:43.792146449 -0500
+++ src/usermod.c 2012-02-13 08:21:19.375114500 -0500
@@ -182,7 +182,7 @@
struct tm *tp;
if (date < 0) {
- strncpy (buf, "never", maxsize);
+ strncpy (buf, "never", maxsize - 1);
} else {
time_t t = (time_t) date;
tp = gmtime (&t);
--- src/login.c.orig 2012-02-13 08:19:50.951994454 -0500
+++ src/login.c 2012-02-13 08:21:04.490430937 -0500
@@ -752,7 +752,8 @@
_("%s login: "), hostn);
} else {
strncpy (loginprompt, _("login: "),
- sizeof (loginprompt));
+ sizeof (loginprompt) - 1);
+ loginprompt[sizeof (loginprompt) - 1] = '\0';
}
retcode = pam_set_item (pamh, PAM_USER_PROMPT, loginprompt);