linux/tools/net/ynl/pyynl
Thaison Phan 153f709c86 tools: ynl: check alloc fails in generated getter code
Generated YNL getter code does not check the return value of malloc() and
calloc() before passing the resulting pointer to memcpy(). This could lead
to a NULL pointer dereference on memory allocation failure.

Updated the C code generator to check for allocation failures and to return
an error code in getters.

Signed-off-by: Thaison Phan <thaisonphan@google.com>
Link: https://patch.msgid.link/20260807171500.7188-3-thaisonphan@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-08-10 18:23:11 -07:00
..
lib tools: ynl: pyynl: pull the --family resolution logic into the lib 2026-07-03 08:57:15 +02:00
__init__.py tools: ynl: pyynl: re-export the library API from the package root 2026-07-03 08:57:15 +02:00
.gitignore tools: ynl: move python code to separate sub-directory 2025-01-09 12:53:27 -08:00
cli.py tools: ynl: pyynl: pull the --family resolution logic into the lib 2026-07-03 08:57:15 +02:00
ynl_gen_c.py tools: ynl: check alloc fails in generated getter code 2026-08-10 18:23:11 -07:00
ynl_gen_rst.py tools: ynl: fix pylint issues in ynl_gen_rst 2026-01-09 08:55:33 -08:00