From 1887a2197af3e17dfad8ca4757c20b91a27aefbb Mon Sep 17 00:00:00 2001 From: Mathieu Date: Mon, 26 Jan 2026 14:24:33 +0100 Subject: [PATCH] Add null checks for iface before accessing index in mpnh_compare_node --- nest/rt-attr.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nest/rt-attr.c b/nest/rt-attr.c index 3db55202..13262b45 100644 --- a/nest/rt-attr.c +++ b/nest/rt-attr.c @@ -234,6 +234,11 @@ mpnh_compare_node(struct mpnh *x, struct mpnh *y) if (r) return r; + if (!x->iface) + return 1; + if (!y->iface) + return -1; + return ((int) x->iface->index) - ((int) y->iface->index); }