GCC 3.3 noticed that checking whether the length of the slice is > 65535
is pointless, as it's a 16-bit unsigned quantity. Remove those checks - but note in a comment that WTAP_MAX_PACKET_SIZE must be at least 65535 (as there might well be link-layer types with packets at least that large). svn path=/trunk/; revision=7934
This commit is contained in:
parent
4d94e1746f
commit
9fa514388c
|
@ -2,7 +2,7 @@
|
|||
* Routines for opening EtherPeek (and TokenPeek?) files
|
||||
* Copyright (c) 2001, Daniel Thompson <d.thompson@gmx.net>
|
||||
*
|
||||
* $Id: etherpeek.c,v 1.22 2002/08/28 20:30:44 jmayer Exp $
|
||||
* $Id: etherpeek.c,v 1.23 2003/06/25 17:35:16 guy Exp $
|
||||
*
|
||||
* Wiretap Library
|
||||
* Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu>
|
||||
|
@ -362,12 +362,6 @@ static gboolean etherpeek_read_v7(wtap *wth, int *err, long *data_offset)
|
|||
sliceLength = length;
|
||||
}
|
||||
|
||||
/* test for corrupt data */
|
||||
if (sliceLength > WTAP_MAX_PACKET_SIZE) {
|
||||
*err = WTAP_ERR_BAD_RECORD;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
*data_offset = wth->data_offset;
|
||||
|
||||
/* fill in packet header length values before slicelength may be
|
||||
|
@ -512,12 +506,6 @@ static gboolean etherpeek_read_v56(wtap *wth, int *err, long *data_offset)
|
|||
sliceLength = length;
|
||||
}
|
||||
|
||||
/* test for corrupt data */
|
||||
if (sliceLength > WTAP_MAX_PACKET_SIZE) {
|
||||
*err = WTAP_ERR_BAD_RECORD;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
*data_offset = wth->data_offset;
|
||||
|
||||
/* fill in packet header values */
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* wtap.h
|
||||
*
|
||||
* $Id: wtap.h,v 1.137 2003/05/15 07:14:46 guy Exp $
|
||||
* $Id: wtap.h,v 1.138 2003/06/25 17:35:17 guy Exp $
|
||||
*
|
||||
* Wiretap Library
|
||||
* Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu>
|
||||
|
@ -175,6 +175,7 @@
|
|||
|
||||
/*
|
||||
* Maximum packet size we'll support.
|
||||
* It must be at least 65535.
|
||||
*/
|
||||
#define WTAP_MAX_PACKET_SIZE 65535
|
||||
|
||||
|
|
Loading…
Reference in New Issue