...
In this example, a VLA of size s
is declared with s
being type size_t
. However, it is unclear whether or not s
is a valid size argument. Depending on how VLAs are implemented s
may be interpreted as a negative value or a very large value. In either case, this may result in unintended program behaviora security vulnerability.
Code Block |
---|
void func(size_t s) { vla[s]; ... } ... func(size); ... |