Some spandsp tweaks after studying a klocwork report

This commit is contained in:
Steve Underwood committed 2013-04-17 09:07:54 +08:00
1 parent b1447dd635
commit 538d9beacd
5 files changed
+22 -13

No files matched your search

+4 -4
View File
@@ -305,9 +305,9 @@ static int receive_xid(v42_state_t *ss, const uint8_t *frame, int len)
param_id = buf[0];
param_len = buf[1];
buf += 2;
group_len -= (2 + param_len);
if (group_len < 0)
if (group_len < (2 + param_len))
break;
group_len -= (2 + param_len);
switch (param_id)
{
case PI_HDLC_OPTIONAL_FUNCTIONS:
@@ -347,9 +347,9 @@ static int receive_xid(v42_state_t *ss, const uint8_t *frame, int len)
param_id = buf[0];
param_len = buf[1];
buf += 2;
group_len -= (2 + param_len);
if (group_len < 0)
if (group_len < 2 + param_len)
break;
group_len -= (2 + param_len);
switch (param_id)
{
case PI_PARAMETER_SET_ID: