From ca3d2113d3f4f1a662b58bb36d28d677b6f4ba00 Mon Sep 17 00:00:00 2001 From: Philippe Guibert Date: Fri, 30 Dec 2022 11:00:25 +0100 Subject: libnetlink: fix a crash with a non vlan interface Fix a segmentation fault when starting when accel-ppp is configured with an non vlan interface. Signed-off-by: Philippe Guibert Signed-off-by: Louis Scalbert --- accel-pppd/libnetlink/iputils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/accel-pppd/libnetlink/iputils.c b/accel-pppd/libnetlink/iputils.c index 550717f..23325fc 100644 --- a/accel-pppd/libnetlink/iputils.c +++ b/accel-pppd/libnetlink/iputils.c @@ -314,7 +314,7 @@ int __export iplink_vlan_get_vid(int ifindex, int *iflink) parse_rtattr_nested(tb, IFLA_MAX, tb[IFLA_LINKINFO]); - if (strcmp(RTA_DATA(tb[IFLA_INFO_KIND]), "vlan")) + if (!tb[IFLA_INFO_KIND] || strcmp(RTA_DATA(tb[IFLA_INFO_KIND]), "vlan")) goto out; parse_rtattr_nested(tb, IFLA_MAX, tb[IFLA_INFO_DATA]); -- cgit v1.2.3