⬢ DragonFlyBSD Kernel Audit
DF-5803 / fix.diff
← back to finding ↓ download raw
--- a/sys/kern/kern_sig.c	2026-10-12 23:31:13.426507977 +0000
+++ b/sys/kern/kern_sig.c	2026-10-12 23:31:13.462507509 +0000
@@ -7,6 +7,7 @@
 				break;
 			case 'N':	/* process name */
 				if ((n + namelen) > MAXPATHLEN) {
+					temp[n] = '\0';
 					log(LOG_ERR,
 					    "pid %d (%s), uid (%u): "
 					    "Path `%s%s' is too long\n",
@@ -20,6 +21,7 @@
 			case 'P':	/* process id */
 				l = ksprintf(buf, "%u", pid);
 				if ((n + l) > MAXPATHLEN) {
+					temp[n] = '\0';
 					log(LOG_ERR,
 					    "pid %d (%s), uid (%u): "
 					    "Path `%s%s' is too long\n",
@@ -33,6 +35,7 @@
 			case 'U':	/* user id */
 				l = ksprintf(buf, "%u", uid);
 				if ((n + l) > MAXPATHLEN) {
+					temp[n] = '\0';
 					log(LOG_ERR,
 					    "pid %d (%s), uid (%u): "
 					    "Path `%s%s' is too long\n",