Re:Variable Length Arrays are problematic
by kbuck on Tuesday July 06, 2021 @02:29AM
(#27744856)
Something that bothered me: The author mentions that the worst case of VLA usage is an exploitable vulnerability, then goes on to call malloc with n * size, where n is controlled by the user. This should either be bounds checked or calloc should be used instead, since the "fix" presented may also introduce an exploitable vulnerability.
[ Parent
| on HN ]
Re:Variable Length Arrays are problematic
by SV_BubbleTime on Wednesday July 07, 2021 @01:45AM
(#27757826)
Bothered me he calls malloc but never frees. It required here, but still good practice to show it.