From: Amit Khatri Date: Thu, 13 Aug 2015 10:26:59 +0000 (+0000) Subject: iw: avoid passing NULL to nla_data() X-Git-Tag: v4.3~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=572e47a34d6d33d89d5d4e4fe675541cd8e8acfb;p=thirdparty%2Fiw.git iw: avoid passing NULL to nla_data() The attr pointer is checked for NULL but the function doesn't handle it appropriately - fix that. Signed-off-by: Amit Khatri Signed-off-by: Rahul Jain Signed-off-by: Johannes Berg --- diff --git a/event.c b/event.c index 5fb5afc..5d0bfde 100644 --- a/event.c +++ b/event.c @@ -49,8 +49,10 @@ static void print_frame(struct print_event_args *args, struct nlattr *attr) char macbuf[6*3]; uint16_t tmp; - if (!attr) + if (!attr) { printf(" [no frame]"); + return; + } frame = nla_data(attr); len = nla_len(attr);