uci: manually clear uci_ptr flags after uci_delete() operations openwrt-19.07
authorJo-Philipp Wich <jo@mein.io>
Wed, 23 Dec 2020 18:06:12 +0000 (19:06 +0100)
committerJo-Philipp Wich <jo@mein.io>
Sun, 17 Jan 2021 20:15:20 +0000 (21:15 +0100)
commitc2a69a364ef857007e752aca11389149ffa4e589
tree1890a74dcca08f9dc6e802b58f6c651e8479d8a6
parent67c8a3fda26e441d3ec4a19f50ac72eca8deb14b
uci: manually clear uci_ptr flags after uci_delete() operations

This is required to avoid potential use-after-free errors through the
uci_set()->uci_delete()->uci_expand_ptr() call chain when passing
zero-length strings as values.

Ref: https://bugs.openwrt.org/index.php?do=details&task_id=3528
Suggested-by: olegio170 <olegios170@gmail.com>
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit d3f2041f4363e76fda57dd6b581eb71cf1a0e114)
uci.c