Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Check that bytes exist in the captured data before fetching them.
  • Loading branch information
guyharris committed Aug 18, 2009
1 parent a82daa1 commit 9da2a96
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions print-sip.c
Expand Up @@ -44,6 +44,7 @@ sip_print(register const u_char *pptr, register u_int len)
return;

for (idx = 0; idx < len; idx++) {
TCHECK2(*(pptr+idx), 2);
if (EXTRACT_16BITS(pptr+idx) != 0x0d0a) { /* linefeed ? */
safeputchar(*(pptr+idx));
} else {
Expand All @@ -57,4 +58,7 @@ sip_print(register const u_char *pptr, register u_int len)
print_unknown_data(pptr,"\n\t",len);

return;

trunc:
printf("[|sip]");
}

0 comments on commit 9da2a96

Please sign in to comment.