audit-userspace icon indicating copy to clipboard operation
audit-userspace copied to clipboard

Patch: realloc on field list overflow

Open wolneykien opened this issue 2 years ago • 3 comments

Re-alloc on field array overflow. Not a linked list as it's slower that the array.

wolneykien avatar Aug 03 '22 20:08 wolneykien

Hi! Just added records with more than 36 fields to the test suite.

wolneykien avatar Aug 20 '22 23:08 wolneykien

OK, I looked this over and have only one concern. (Thanks for the patch btw!) The nvlist_clear function is used to release all memory used by the nvlist. The patch reallocs the array back to NFIELDS which seems reasonable as that mimics how it would be with a static sized array. But we'll leak memory especially as used in ellist.c.

This is simple enough I can fix it after the merge. Or if you want to fix that issue I'll merge the whole thing. Up to you.

stevegrubb avatar Aug 24 '22 18:08 stevegrubb

Oh, thanks! It was stupid enough to mimic static behaviour with dynamic memory… Fixed that issue and also indentation.

wolneykien avatar Aug 24 '22 22:08 wolneykien

Thanks for the patch! Merging.

stevegrubb avatar Aug 25 '22 20:08 stevegrubb