[PATCH 0/9] uci: fixes for uci_set and uci_add_list

Jan Venekamp jan at venekamp.net
Tue Aug 16 04:23:49 PDT 2022


When developing a C application that updates options with uci_set I
noticed that config files were not getting these updates. I found
that this was due to a use-after-free bug in uci_set.

Looking further at the code I also noticed some other issues. This
patch series contains fixes to these issues as well as some other
improvements.

Jan Venekamp (9):
  uci: fix use-after-free uci_set on update option
  uci: maintain option position in uci_set
  uci: optimize update option in uci_set
  uci: fix use-after-free uci_add_list
  uci: fix atomicity of uci_add_list
  uci: maintain option position in uci_add_list
  uci: fix memory leak uci_set on update section
  uci: optimize update section in uci_set
  uci: macro uci_alloc_element not in uci.h

 list.c                                | 168 ++++++++++++--------------
 tests/shunit2/tests.d/090_cli_options |   8 +-
 uci.h                                 |  10 --
 uci_internal.h                        |   3 +
 4 files changed, 87 insertions(+), 102 deletions(-)

-- 
2.32.0 (Apple Git-132)




More information about the openwrt-devel mailing list