Skip to content

Commit

Permalink
drivers/gamatronic.c: report a response buffer overflow (should not h…
Browse files Browse the repository at this point in the history
…appen though) [networkupstools#2427]

Signed-off-by: Jim Klimov <[email protected]>
  • Loading branch information
jimklimov committed May 3, 2024
1 parent 5086b2b commit 0a2cf8a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/gamatronic.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ static int sec_upsrecv (char *buf)
lenbuf[3] = '\0';
ret = atoi(lenbuf);
if (ret > GAMATRONIC_BUF_LEN) {
upslogx(1, "%s: got a longer response from "
"ser_get_line() than expected: %d > %d",
__func__, ret, GAMATRONIC_BUF_LEN);
ret = GAMATRONIC_BUF_LEN;
}
if (ret > 0) {
Expand Down

0 comments on commit 0a2cf8a

Please sign in to comment.