[Snort-devel] need help in understanding a piece of code in snort 220.127.116.11
vickyatwork0 at ...2499...
Fri May 27 05:43:58 EDT 2016
I need some help in understanding a piece of qsort usage on pointer in the
function PortTableCompileMergePortObjectList2() of the file
snort-18.104.22.168/src/sfutil/sfportobject.c. Below is the comment mentioned in
/* Sort the pointers to the input port objects so
we always get them in the same order for key comparisons */
This piece of code sorts a list of pointers to port objects before merging
them. PortObjects are calloc'ed on the fly and on multiple run order of
memory allocated to different portObject may vary. I'm not able to
understand what value add this pointer sort adds here.
I tried removing this qsort and found attack detection to be working
properly. Can someone please help me understand the importance/usage of
pointer sort in this context?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Snort-devel