Search Linux Wireless

[PATCH 2/3] iw: Avoid NULL attr value to pass in nla_data.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



value of attr may be NULL so check before passing
to function.

Signed-off-by: Amit Khatri <amit.khatri@xxxxxxxxxxx>
Signed-off-by: Rahul Jain <rahul.jain@xxxxxxxxxxx>
---
 event.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

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);
--
1.9.1
��.n��������+%������w��{.n�����{���zW����ܨ}���Ơz�j:+v�����w����ޙ��&�)ߡ�a����z�ޗ���ݢj��w�f




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux