diff options
author | Jakub Kicinski <kuba@kernel.org> | 2023-06-06 22:43:01 +0300 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2023-06-07 22:53:10 +0300 |
commit | 58da455b31baf87dd74b71fc54d0356e05c0bf49 (patch) | |
tree | a16642c51d329b448b9a873cd5a41784df22d2bb /tools/net/ynl/generated/handshake-user.c | |
parent | 2cc9671a82e3ba8911f01b04fd8f8f2da3a238a7 (diff) | |
download | linux-58da455b31baf87dd74b71fc54d0356e05c0bf49.tar.xz |
tools: ynl-gen: improve unwind on parsing errors
When parsing multi-attr we count the objects and then allocate
an array to hold the parsed objects. If an attr space has multiple
multi-attr objects, however, if parsing the first array fails
we'll leave the object count for the second even tho the second
array was never allocated.
This may cause crashes when freeing objects on error.
Count attributes to a variable on the stack and only set the count
in the object once the memory was allocated.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools/net/ynl/generated/handshake-user.c')
0 files changed, 0 insertions, 0 deletions