summaryrefslogtreecommitdiff
path: root/system/sysvinit/bounds.patch
diff options
context:
space:
mode:
Diffstat (limited to 'system/sysvinit/bounds.patch')
-rw-r--r--system/sysvinit/bounds.patch19
1 files changed, 19 insertions, 0 deletions
diff --git a/system/sysvinit/bounds.patch b/system/sysvinit/bounds.patch
new file mode 100644
index 000000000..bf30d56e2
--- /dev/null
+++ b/system/sysvinit/bounds.patch
@@ -0,0 +1,19 @@
+--- sysvinit-3.14/src/dowall.c.old 2025-06-24 02:38:56.414501867 -0500
++++ sysvinit-3.14/src/dowall.c 2025-06-25 01:36:34.943110622 -0500
+@@ -44,6 +44,7 @@
+ #ifndef HOST_NAME_MAX
+ # define HOST_NAME_MAX 255
+ #endif
++#define MIN(a,b) (((a)<(b))?(a):(b))
+
+ static sigjmp_buf jbuf;
+
+@@ -226,7 +227,7 @@
+ utmp->ut_user[0] == 0) continue;
+ if (strncmp(utmp->ut_line, _PATH_DEV, strlen(_PATH_DEV)) == 0) {
+ term[0] = 0;
+- strncat(term, utmp->ut_line, sizeof(term)-1);
++ strncat(term, utmp->ut_line, MIN(UT_LINESIZE,sizeof(term)-1));
+ } else
+ snprintf(term, sizeof(term), _PATH_DEV "%.*s",
+ UT_LINESIZE, utmp->ut_line);