From: Victor Julien Date: Tue, 28 Oct 2014 17:25:33 +0000 (+0100) Subject: smtp: improve ProcessDataChunk error checking X-Git-Tag: suricata-2.1beta2~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9d33131d37f633a1ab67e69df5857eec19e45126;p=thirdparty%2Fsuricata.git smtp: improve ProcessDataChunk error checking --- diff --git a/src/app-layer-smtp.c b/src/app-layer-smtp.c index c08ce72315..e58eccb0d4 100644 --- a/src/app-layer-smtp.c +++ b/src/app-layer-smtp.c @@ -366,6 +366,7 @@ static int ProcessDataChunk(const uint8_t *chunk, uint32_t len, ret = FileCloseFile(files, (uint8_t *) NULL, 0, flags); if (ret != 0) { SCLogDebug("FileCloseFile() failed: %d", ret); + ret = MIME_DEC_ERR_DATA; } } else { SCLogDebug("File already closed"); @@ -379,6 +380,7 @@ static int ProcessDataChunk(const uint8_t *chunk, uint32_t len, ret = FileCloseFile(files, (uint8_t *) chunk, len, flags); if (ret != 0) { SCLogDebug("FileCloseFile() failed: %d", ret); + ret = MIME_DEC_ERR_DATA; } } else { SCLogDebug("File already closed"); @@ -394,10 +396,11 @@ static int ProcessDataChunk(const uint8_t *chunk, uint32_t len, SCLogDebug("FileAppendData() - file no longer being extracted"); } else if (ret < 0) { SCLogDebug("FileAppendData() failed: %d", ret); + ret = MIME_DEC_ERR_DATA; } } - if (ret == MIME_DEC_OK) { + if (ret == 0) { SCLogDebug("Successfully processed file data!"); } } else {