Skip to content

Commit

Permalink
Use smaller buffer for strncpy().
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rhymeswithmogul committed Nov 1, 2024
1 parent 03cebdc commit b5888aa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/aprs-is.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b5888aa

Please sign in to comment.