Skip to content

Commit

Permalink
compression: add logging for overflow condition
Browse files Browse the repository at this point in the history
  • Loading branch information
john08burke committed Sep 22, 2021
1 parent 6ed68a5 commit a5b6d2e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modules/compression/compression.c
Original file line number Diff line number Diff line change
Expand Up @@ -950,6 +950,10 @@ static int mc_compact_cb(char** buf_p, mc_whitelist_p wh_list, int type, int* ol
memcpy(*buf_p, new_buf.s, new_buf.len);
*olen = new_buf.len;

if (new_buf.len > msg_total_len)
LM_BUG("buffer overflow: "\
"calculated=%d, actual=%d\n", msg_total_len, new_buf.len);

/* Free the vector */
pkg_free(hdr_mask);

Expand Down

0 comments on commit a5b6d2e

Please sign in to comment.