Snort mailing list archives
Re: [SNORT-DEVEL] Fix memory leak in Snort 2.9.7.0-alpha
From: "Josh Rosenbaum (jrosenba)" <jrosenba () cisco com>
Date: Mon, 19 May 2014 13:44:12 +0000
Hi Bill, Thank you for both reporting this bug and the patch. The problem has already been fixed and will be part of the next Snort release. Josh From: Bill Parker <wp02855 () gmail com<mailto:wp02855 () gmail com>> Date: Sunday, May 18, 2014 at 6:55 PM To: "snort-devel () lists sourceforge net<mailto:snort-devel () lists sourceforge net>" <snort-devel () lists sourceforge net<mailto:snort-devel () lists sourceforge net>> Subject: [Snort-devel] [SNORT-DEVEL] Fix memory leak in Snort 2.9.7.0-alpha Hi All, In reviewing file 'luaDetectorApi.c' in directory 'snort-2.9.7.0.alpha/src/dynamic-preprocessors/appid', I found a small memory leak involving variable 'schemePattern' where the memory isn't released due to a strdup() call failing. The patch file is listed below: --- luaDetectorApi.c.orig 2014-03-09 18:35:09.650653721 -0700 +++ luaDetectorApi.c 2014-05-17 19:44:33.408223503 -0700 @@ -2102,6 +2120,14 @@ if(tmpString && queryPatternSize) { queryPattern = (u_int8_t*) strdup(tmpString); + if (!queryPattern) + { + _dpd.errMsg( "Invalid query pattern string."); + free(pathPattern); + free(hostPattern); + free(schemePattern); + return 0; + } } u_int32_t appId = lua_tointeger(L, index++); The free(schemePattern); was left out of the previously submitted patch for this file (my bad) <duh>. I'm attaching the patch file to this bug report. Bill Parker (wp02855 at gmail dot com)
------------------------------------------------------------------------------ "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE Instantly run your Selenium tests across 300+ browser/OS combos. Get unparalleled scalability from the best Selenium testing platform available Simple to use. Nothing to install. Get started now for free." http://p.sf.net/sfu/SauceLabs
_______________________________________________ Snort-devel mailing list Snort-devel () lists sourceforge net https://lists.sourceforge.net/lists/listinfo/snort-devel Archive: http://sourceforge.net/mailarchive/forum.php?forum_name=snort-devel Please visit http://blog.snort.org for the latest news about Snort!
Current thread:
- [SNORT-DEVEL] Fix memory leak in Snort 2.9.7.0-alpha Bill Parker (May 18)
- Re: [SNORT-DEVEL] Fix memory leak in Snort 2.9.7.0-alpha Josh Rosenbaum (jrosenba) (May 19)