Fix fragment length checks. Fixes bugs 440 and 442-446.

svn path=/trunk/; revision=15824
This commit is contained in:
Gerald Combs 2005-09-15 18:42:04 +00:00
parent 46276102d9
commit e777958eb6
1 changed files with 2 additions and 2 deletions

View File

@ -1122,13 +1122,13 @@ dissect_fc_helper (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean
* these frames. * these frames.
*/ */
if ((pinfo->ethertype == ETHERTYPE_UNK) || (pinfo->ethertype == ETHERTYPE_FCFT)) { if ((pinfo->ethertype == ETHERTYPE_UNK) || (pinfo->ethertype == ETHERTYPE_FCFT)) {
if ((frag_size <= MDSHDR_TRAILER_SIZE) && if ((frag_size <= MDSHDR_TRAILER_SIZE) ||
((frag_size == MDSHDR_TRAILER_SIZE) && (ftype != FC_FTYPE_LINKCTL) && ((frag_size == MDSHDR_TRAILER_SIZE) && (ftype != FC_FTYPE_LINKCTL) &&
(ftype != FC_FTYPE_BLS) && (ftype != FC_FTYPE_OHMS))) (ftype != FC_FTYPE_BLS) && (ftype != FC_FTYPE_OHMS)))
THROW(ReportedBoundsError); THROW(ReportedBoundsError);
frag_size -= MDSHDR_TRAILER_SIZE; frag_size -= MDSHDR_TRAILER_SIZE;
} else if (pinfo->ethertype == ETHERTYPE_BRDWALK) { } else if (pinfo->ethertype == ETHERTYPE_BRDWALK) {
if ((frag_size <= 8) && if ((frag_size <= 8) ||
((frag_size == MDSHDR_TRAILER_SIZE) && (ftype != FC_FTYPE_LINKCTL) && ((frag_size == MDSHDR_TRAILER_SIZE) && (ftype != FC_FTYPE_LINKCTL) &&
(ftype != FC_FTYPE_BLS) && (ftype != FC_FTYPE_OHMS))) (ftype != FC_FTYPE_BLS) && (ftype != FC_FTYPE_OHMS)))
THROW(ReportedBoundsError); THROW(ReportedBoundsError);