Module Name: src Committed By: christos Date: Wed Mar 26 00:03:16 UTC 2025
Modified Files: src/external/bsd/blocklist/lib: bl.c Log Message: GitHub/26: jlduran: Fix off-by-one less character To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 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.4 src/external/bsd/blocklist/lib/bl.c:1.5 --- src/external/bsd/blocklist/lib/bl.c:1.4 Tue Feb 11 12:45:01 2025 +++ src/external/bsd/blocklist/lib/bl.c Tue Mar 25 20:03:16 2025 @@ -1,4 +1,4 @@ -/* $NetBSD: bl.c,v 1.4 2025/02/11 17:45:01 christos Exp $ */ +/* $NetBSD: bl.c,v 1.5 2025/03/26 00:03:16 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.4 2025/02/11 17:45:01 christos Exp $"); +__RCSID("$NetBSD: bl.c,v 1.5 2025/03/26 00:03:16 christos Exp $"); #include <sys/param.h> #include <sys/types.h> @@ -538,10 +538,11 @@ bl_recv(bl_t b) bi->bi_uid = -1; bi->bi_gid = -1; #endif - rem = MIN(sizeof(bi->bi_msg), rem); if (rem == 0) bi->bi_msg[0] = '\0'; - else + else { + rem = MIN(sizeof(bi->bi_msg), rem + 1); strlcpy(bi->bi_msg, ub.bl.bl_data, rem); + } return bi; }