Bug #88 » 0002-smb-safety-checks.patch
src/app-layer-smb.c | ||
---|---|---|
sstate->nbss.length, parsed, input_len);
|
||
} else if (input_len) {
|
||
SCLogDebug("Error parsing NBSS Header\n");
|
||
parsed += input_len;
|
||
input_len = 0;
|
||
sstate->bytesprocessed = 0;
|
||
SCReturnInt(-1);
|
||
}
|
||
}
|
||
... | ... | |
if (retval == -1) {
|
||
SCLogDebug("Error parsing SMB Header\n");
|
||
sstate->bytesprocessed = 0;
|
||
SCReturnInt(1);
|
||
SCReturnInt(-1);
|
||
} else {
|
||
parsed += retval;
|
||
input_len -= retval;
|
||
... | ... | |
input_len -= retval;
|
||
} else if (input_len) {
|
||
SCLogDebug("Error parsing SMB Word Count\n");
|
||
parsed += input_len;
|
||
input_len = 0;
|
||
sstate->bytesprocessed = 0;
|
||
SCReturnInt(-1);
|
||
}
|
||
}
|
||
SCLogDebug("SMB Header (%u/%u) Command 0x%02x WordCount %u parsed %ld input_len %u\n",
|
||
... | ... | |
input_len -= retval;
|
||
} else if (input_len) {
|
||
SCLogDebug("Error parsing SMB Word Count Data\n");
|
||
parsed += input_len;
|
||
input_len = 0;
|
||
sstate->bytesprocessed = 0;
|
||
SCReturnInt(-1);
|
||
}
|
||
}
|
||
... | ... | |
input_len -= retval;
|
||
} else if (input_len) {
|
||
SCLogDebug("Error parsing SMB Byte Count\n");
|
||
parsed += input_len;
|
||
input_len = 0;
|
||
sstate->bytesprocessed = 0;
|
||
SCReturnInt(-1);
|
||
}
|
||
}
|
||
... | ... | |
input_len -= retval;
|
||
} else if (input_len) {
|
||
SCLogDebug("Error parsing SMB Byte Count Data\n");
|
||
parsed += input_len;
|
||
input_len = 0;
|
||
sstate->bytesprocessed = 0;
|
||
SCReturnInt(-1);
|
||
}
|
||
}
|
||
... | ... | |
&& input_len);
|
||
if (sstate->bytesprocessed >= sstate->nbss.length + NBSS_HDR_LEN) {
|
||
sstate->bytesprocessed = 0;
|
||
sstate->bytesprocessed = 0;
|
||
}
|
||
break;
|
||
default:
|
||
sstate->bytesprocessed = 0;
|
||
sstate->bytesprocessed = 0;
|
||
break;
|
||
}
|
||
pstate->parse_field = 0;
|