summaryrefslogtreecommitdiffstats
path: root/src/libsystemd
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2022-11-26 01:57:16 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2022-11-26 03:28:27 +0100
commit766417bd763db913efdd9c48442b1094c23d7042 (patch)
tree85434bc478febdaf8e3659be1cab91377ae32247 /src/libsystemd
parentsd-netlink: fix possible use-after-free (diff)
downloadsystemd-766417bd763db913efdd9c48442b1094c23d7042.tar.xz
systemd-766417bd763db913efdd9c48442b1094c23d7042.zip
sd-netlink: fix segfault
Diffstat (limited to 'src/libsystemd')
-rw-r--r--src/libsystemd/sd-netlink/sd-netlink.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libsystemd/sd-netlink/sd-netlink.c b/src/libsystemd/sd-netlink/sd-netlink.c
index 1202fe10a5..ec1035fdd1 100644
--- a/src/libsystemd/sd-netlink/sd-netlink.c
+++ b/src/libsystemd/sd-netlink/sd-netlink.c
@@ -593,7 +593,8 @@ int sd_netlink_read(
return r;
if (type == NLMSG_DONE) {
- *ret = NULL;
+ if (ret)
+ *ret = NULL;
return 0;
}