]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-netlink: fix segfault
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 26 Nov 2022 00:57:16 +0000 (09:57 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 26 Nov 2022 02:28:27 +0000 (11:28 +0900)
src/libsystemd/sd-netlink/sd-netlink.c

index 1202fe10a55eecdbe21da15d702909dbbe923d14..ec1035fdd10ab19595ab09e0bfd60420526ded2c 100644 (file)
@@ -593,7 +593,8 @@ int sd_netlink_read(
                                 return r;
 
                         if (type == NLMSG_DONE) {
-                                *ret = NULL;
+                                if (ret)
+                                        *ret = NULL;
                                 return 0;
                         }