mirror of
https://gitdl.cn/https://github.com/chakralinux/core.git
synced 2025-01-24 10:32:15 +08:00
28 lines
1.0 KiB
Diff
28 lines
1.0 KiB
Diff
diff -ur shadow-4.1.4.3.orig/src/login.c shadow-4.1.4.3/src/login.c
|
|
--- shadow-4.1.4.3.orig/src/login.c 2011-03-05 22:17:10.032524948 -0800
|
|
+++ shadow-4.1.4.3/src/login.c 2011-03-05 22:17:59.154342059 -0800
|
|
@@ -748,8 +748,9 @@
|
|
sizeof (loginprompt),
|
|
_("%s login: "), hostn);
|
|
} else {
|
|
+ loginprompt[sizeof (loginprompt) - 1] = '\0';
|
|
strncpy (loginprompt, _("login: "),
|
|
- sizeof (loginprompt));
|
|
+ sizeof (loginprompt) - 1);
|
|
}
|
|
|
|
retcode = pam_set_item (pamh, PAM_USER_PROMPT, loginprompt);
|
|
diff -ur shadow-4.1.4.3.orig/src/usermod.c shadow-4.1.4.3/src/usermod.c
|
|
--- shadow-4.1.4.3.orig/src/usermod.c 2011-03-05 22:17:10.029191265 -0800
|
|
+++ shadow-4.1.4.3/src/usermod.c 2011-03-05 22:18:42.665576968 -0800
|
|
@@ -182,7 +182,8 @@
|
|
struct tm *tp;
|
|
|
|
if ((negativ != NULL) && (date < 0)) {
|
|
- strncpy (buf, negativ, maxsize);
|
|
+ buf[maxsize - 1] = '\0';
|
|
+ strncpy (buf, negativ, maxsize - 1);
|
|
} else {
|
|
time_t t = (time_t) date;
|
|
tp = gmtime (&t);
|