Clean up a bit.

svn path=/trunk/; revision=48937
This commit is contained in:
Guy Harris 2013-04-19 18:48:16 +00:00
parent c7e09b6ca7
commit 36dfc6b108
1 changed files with 11 additions and 14 deletions

View File

@ -373,24 +373,21 @@ check_offset_length_no_exception(const tvbuff_t *tvb,
if (end_offset <= tvb->length) {
return TRUE;
}
else if (end_offset <= tvb->fragment_length) {
if (exception) {
*exception = BoundsError;
}
}
else if (end_offset <= tvb->reported_length) {
if (exception) {
*exception = FragmentBoundsError;
}
return FALSE;
}
else {
if (exception) {
*exception = ReportedBoundsError;
if (end_offset <= tvb->fragment_length) {
*exception = BoundsError;
}
else if (end_offset <= tvb->reported_length) {
*exception = FragmentBoundsError;
}
else {
*exception = ReportedBoundsError;
}
}
}
return FALSE;
return FALSE;
}
}
/* Checks (+/-) offset and length and throws an exception if