mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
SMTP: Reset ContentLineAnalyzer plain delivery on EndData()
When resetting the BDAT state, we also need to switch the ContentLine analyzer back into line mode, otherwise we're feeding plain delivery data through ProcessLine(), possibly violating some assumptions about null termination. Do it for both ContentLineAnalyzers - only one of them will be in plain delivery mode anyhow, but we don't keep state which one it was.
This commit is contained in:
parent
9a510b8035
commit
bc357c6ca1
1 changed files with 6 additions and 0 deletions
|
@ -899,6 +899,12 @@ void SMTP_Analyzer::BeginData(bool orig, detail::SMTP_State new_state) {
|
||||||
|
|
||||||
void SMTP_Analyzer::EndData() {
|
void SMTP_Analyzer::EndData() {
|
||||||
if ( bdat ) {
|
if ( bdat ) {
|
||||||
|
if ( bdat->RemainingChunkSize() > 0 ) {
|
||||||
|
Weird("smtp_bdat_remaining_at_end_data");
|
||||||
|
cl_orig->SetPlainDelivery(0);
|
||||||
|
cl_resp->SetPlainDelivery(0);
|
||||||
|
}
|
||||||
|
|
||||||
bdat->Done();
|
bdat->Done();
|
||||||
bdat.reset();
|
bdat.reset();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue