]> Kevux Git Server - controller/commit
Security: Changes to f_memory_array_increase() API causes invalid memory access.
authorKevin Day <Kevin@kevux.org>
Wed, 11 Sep 2024 22:32:38 +0000 (17:32 -0500)
committerKevin Day <Kevin@kevux.org>
Wed, 11 Sep 2024 22:37:26 +0000 (17:37 -0500)
commitbc2fa2d9d39bd0a630d2a3f781fcc84ec0651ee5
tree8710165c74fd9690b94b71b41087013f9aea7232
parente21f342130bbb254d4560435172bfd6ba5076081
Security: Changes to f_memory_array_increase() API causes invalid memory access.

This is a security related regression.
The `f_memory_array_increase()` has been changed to only guarantee that at least 1 element is increased if not available.
The code is Controller is depending on the old behavior where the allocation step is guaranteed.

The new behavior of `f_memory_array_increase()` performs additional steps to prevent memory abuse which in tern causes the first allocation to only consist of a single element.

Use instead `f_memory_array_resize()` if the size is too small.

In another case, instead use `f_memory_array_increase_by()` to ensure that the increase is at least 2 elements.
sources/c/program/controller/main/entry/preprocess.c
sources/c/program/controller/main/entry/process.c