]> git.ipfire.org Git - thirdparty/suricata.git/commit
app-layer-smtp: fix mem leak and add new alert
authorEric Leblond <eric@regit.org>
Tue, 1 Mar 2016 14:44:27 +0000 (15:44 +0100)
committerVictor Julien <victor@inliniac.net>
Wed, 2 Mar 2016 13:10:01 +0000 (14:10 +0100)
commit10e2e2a8b6e5ffabcbc85708c57627dc0be7e087
tree8e16e050d359b2cb49e6f1e309f78fe62341ccba
parent50ad1ce3071a4bfd428db4992f4f5e5a92ec9424
app-layer-smtp: fix mem leak and add new alert

If SMTP session is weird then we may reach a state where a field
like MAIL FROM is seen as duplicated.

Valgrind output is:

30 bytes in 1 blocks are definitely lost in loss record 96 of 399
   at 0x4C29C0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x4A5803: SMTPParseCommandWithParam (app-layer-smtp.c:996)
   by 0x4A4DCE: SMTPParseCommandMAILFROM (app-layer-smtp.c:1016)
   by 0x4A3F55: SMTPProcessRequest (app-layer-smtp.c:1127)
   by 0x4A1F8C: SMTPParse (app-layer-smtp.c:1191)
   by 0x493AD7: SMTPParseClientRecord (app-layer-smtp.c:1214)
   by 0x4878A6: AppLayerParserParse (app-layer-parser.c:908)
   by 0x42384E: AppLayerHandleTCPData (app-layer.c:444)
   by 0x8D7EAD: DoReassemble (stream-tcp-reassemble.c:2635)
   by 0x8D795F: StreamTcpReassembleAppLayer (stream-tcp-reassemble.c:3028)
   by 0x8D8BE0: StreamTcpReassembleHandleSegmentUpdateACK (stream-tcp-reassemble.c:3404)
   by 0x8D8F6E: StreamTcpReassembleHandleSegment (stream-tcp-reassemble.c:3432)
rules/smtp-events.rules
src/app-layer-smtp.c
src/app-layer-smtp.h