]> git.ipfire.org Git - thirdparty/iw.git/commitdiff
iw: avoid passing NULL to nla_data()
authorAmit Khatri <amit.khatri@samsung.com>
Thu, 13 Aug 2015 10:26:59 +0000 (10:26 +0000)
committerJohannes Berg <johannes.berg@intel.com>
Thu, 13 Aug 2015 13:20:23 +0000 (15:20 +0200)
The attr pointer is checked for NULL but the function
doesn't handle it appropriately - fix that.

Signed-off-by: Amit Khatri <amit.khatri@samsung.com>
Signed-off-by: Rahul Jain <rahul.jain@samsung.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
event.c

diff --git a/event.c b/event.c
index 5fb5afc6c4dd95a804abd75e463e05d5997de971..5d0bfde0e50f2c1b3aff3e923fbd9cd5f092ebf1 100644 (file)
--- 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);