u_int seqid = 0;
u_char arc_type;
- if (caplen < ARC_HDRLEN) {
+ if (caplen < ARC_HDRLEN || length < ARC_HDRLEN) {
printf("[|arcnet]");
- return (caplen);
}
ap = (const struct arc_header *)p;
}
if (phds) {
- if (caplen < ARC_HDRNEWLEN) {
+ if (caplen < ARC_HDRNEWLEN || length < ARC_HDRNEWLEN) {
arcnet_print(p, length, 0, 0, 0);
printf("[|phds]");
return (caplen);
}
if (ap->arc_flag == 0xff) {
- if (caplen < ARC_HDRNEWLEN_EXC) {
+ if (caplen < ARC_HDRNEWLEN_EXC || length < ARC_HDRNEWLEN_EXC) {
arcnet_print(p, length, 0, 0, 0);
printf("[|phds extended]");
return (caplen);
int archdrlen = 0;
u_char arc_type;
- if (caplen < ARC_LINUX_HDRLEN) {
+ if (caplen < ARC_LINUX_HDRLEN || length < ARC_LINUX_HDRLEN) {
printf("[|arcnet]");
return (caplen);
}
switch (arc_type) {
default:
archdrlen = ARC_LINUX_HDRNEWLEN;
- if (caplen < ARC_LINUX_HDRNEWLEN) {
+ if (caplen < ARC_LINUX_HDRNEWLEN || length < ARC_LINUX_HDRNEWLEN) {
printf("[|arcnet]");
return (caplen);
}