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

24 lines
716 B
Diff

--- a/src/usermod.c 2012-02-13 08:19:43.792146449 -0500
+++ b/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);
--- a/src/login.c 2012-02-13 08:19:50.951994454 -0500
+++ b/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);