mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-24 05:38:11 +00:00
Added check for negative offset in cid spill to prevent infinite loops
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@63786 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -636,6 +636,12 @@ int callerid_feed(struct callerid_state *cid, unsigned char *ubuf, int len, int
|
|||||||
default:
|
default:
|
||||||
ast_log(LOG_NOTICE, "Unknown IE %d\n", cid->rawdata[x - 1]);
|
ast_log(LOG_NOTICE, "Unknown IE %d\n", cid->rawdata[x - 1]);
|
||||||
}
|
}
|
||||||
|
if(0 > cid->rawdata[x]){ /* Negative offset in the CID Spill */
|
||||||
|
ast_log(LOG_NOTICE, "IE %d has bad field length of %d at offset %d\n", cid->rawdata[x-1], cid->rawdata[x], x);
|
||||||
|
/* Try again */
|
||||||
|
cid->sawflag = 0;
|
||||||
|
break; /* Exit the loop */
|
||||||
|
}
|
||||||
x += cid->rawdata[x];
|
x += cid->rawdata[x];
|
||||||
x++;
|
x++;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user