Module Name: src
Committed By: christos
Date: Sun Mar 30 01:53:59 UTC 2025
Modified Files:
src/external/bsd/blocklist/lib: bl.c
Log Message:
PR/59218: Taylor R Campbell: fix NUL termination
To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/bsd/blocklist/lib/bl.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/external/bsd/blocklist/lib/bl.c
diff -u src/external/bsd/blocklist/lib/bl.c:1.8 src/external/bsd/blocklist/lib/bl.c:1.9
--- src/external/bsd/blocklist/lib/bl.c:1.8 Sat Mar 29 19:25:57 2025
+++ src/external/bsd/blocklist/lib/bl.c Sat Mar 29 21:53:59 2025
@@ -1,4 +1,4 @@
-/* $NetBSD: bl.c,v 1.8 2025/03/29 23:25:57 christos Exp $ */
+/* $NetBSD: bl.c,v 1.9 2025/03/30 01:53:59 christos Exp $ */
/*-
* Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
#ifdef HAVE_SYS_CDEFS_H
#include <sys/cdefs.h>
#endif
-__RCSID("$NetBSD: bl.c,v 1.8 2025/03/29 23:25:57 christos Exp $");
+__RCSID("$NetBSD: bl.c,v 1.9 2025/03/30 01:53:59 christos Exp $");
#include <sys/param.h>
#include <sys/types.h>
@@ -548,7 +548,7 @@ bl_recv(bl_t b)
else {
rem = MIN(sizeof(bi->bi_msg) - 1, rem);
memcpy(bi->bi_msg, ub.bl.bl_data, rem);
- bi->bi_msg[sizeof(bi->bi_msg) - 1] = '\0';
+ bi->bi_msg[rem] = '\0';
}
return bi;
}