Skip to content

Commit 15663e3

Browse files
authored
Merge pull request from GHSA-2qpg-f6wf-w984
1 parent f6dfae1 commit 15663e3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Diff for: pjnath/src/pjnath/stun_msg.c

+3
Original file line numberDiff line numberDiff line change
@@ -1763,6 +1763,9 @@ static pj_status_t decode_errcode_attr(pj_pool_t *pool,
17631763
/* Get pointer to the string in the message */
17641764
value.ptr = ((char*)buf + ATTR_HDR_LEN + 4);
17651765
value.slen = attr->hdr.length - 4;
1766+
/* Make sure the length is never negative */
1767+
if (value.slen < 0)
1768+
value.slen = 0;
17661769

17671770
/* Copy the string to the attribute */
17681771
pj_strdup(pool, &attr->reason, &value);

0 commit comments

Comments
 (0)