From b5888aac756977e509b95c2109f34f9c3d7a8f32 Mon Sep 17 00:00:00 2001 From: Colin Cogle Date: Thu, 31 Oct 2024 22:18:57 -0400 Subject: [PATCH] Use smaller buffer for strncpy(). This commit (hopefully) fixes an issue with `strncpy()` that Codacy pointed out. I changed the "n" value from BUFSIZE to a saner 14 characters, the length of the string plus room for the NULL terminator. --- src/aprs-is.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/aprs-is.c b/src/aprs-is.c index d170e78..1bcf6e7 100755 --- a/src/aprs-is.c +++ b/src/aprs-is.c @@ -133,7 +133,7 @@ sendPacket (const char* const restrict server, if (timeout <= 0) { - strncpy(timeoutText, " (no timeout)", BUFSIZE); + strncpy(timeoutText, " (no timeout)", 14); } switch (addressinfo->sa_family)