]> git.ipfire.org Git - thirdparty/systemd.git/commit
sd-netlink: fix deep recursion in message destruction (#3455)
authorDavid Herrmann <dh.herrmann@googlemail.com>
Tue, 7 Jun 2016 08:38:33 +0000 (10:38 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 7 Jun 2016 08:38:33 +0000 (10:38 +0200)
commit82e4eda664d40ef60829e27d84b1610c2f4070cd
tree2343814aeed404b9f112c77fd04069bccb5d7b5f
parent138f4c69064504bf7ef83cc8a53133f007ad84d6
sd-netlink: fix deep recursion in message destruction (#3455)

On larger systems we might very well see messages with thousands of parts.
When we free them, we must avoid recursing into each part, otherwise we
very likely get stack overflows.

Fix sd_netlink_message_unref() to use an iterative approach rather than
recursion (also avoid tail-recursion in case it is not optimized by the
compiler).
src/libsystemd/sd-netlink/netlink-message.c