rsyslog / liblognorm

a fast samples-based log normalization library
http://www.liblognorm.com
GNU Lesser General Public License v2.1
99 stars 64 forks source link

Fix for use after free (issue #235) #289

Closed 20ton closed 6 years ago

20ton commented 6 years ago

The problem occurs when a user type references another user type : a pointer to the first type is stored in the second, but the array is realloc-ed when you add a third user type, and the pointer becomes invalid. See issue for more details

1st commit for the test case 2nd will be the fix: use an index instead of a pointer

rgerhards commented 6 years ago

Thanks for the PR. I need to reverse the order of the commits as otherwise git bisetc will bail out when used sometime later and it bisects after the first commit. I am also happy if you prefer to do that yourself. Just let me know. If you do it, I would also appreciate a rebase as I have fixes in master for the CI environment.

20ton commented 6 years ago

OK, rebased and reordered (I hope). Let me know if there's anything wrong

rgerhards commented 6 years ago

thx! It looks like one PR was missing from master, this is most probably why you still get CI failures. I'll do a test PR with your changes. I assume it will run through and if so I can merge.

rgerhards commented 6 years ago

CI failures were indeed due to missing commit in master; merge PR went all well, so merging.