From c3327e12c8f381b9c860b118d9775201d57286ba Mon Sep 17 00:00:00 2001 From: Samuel Ortiz Date: Tue, 31 Jan 2012 13:10:37 +0100 Subject: netlink: Check for device protocols attribute not being NULL --- src/netlink.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/netlink.c') diff --git a/src/netlink.c b/src/netlink.c index 8b50c43..8ddd091 100644 --- a/src/netlink.c +++ b/src/netlink.c @@ -163,7 +163,9 @@ static int get_devices_handler(struct nl_msg *n, void *arg) genlmsg_parse(nlh, 0, attrs, NFC_ATTR_MAX, NULL); - if (!attrs[NFC_ATTR_DEVICE_INDEX] || !attrs[NFC_ATTR_DEVICE_NAME]) { + if (attrs[NFC_ATTR_DEVICE_INDEX] == NULL || + attrs[NFC_ATTR_DEVICE_NAME] == NULL || + attrs[NFC_ATTR_PROTOCOLS] == NULL) { nl_perror(NLE_MISSING_ATTR, "NFC_CMD_GET_DEVICE"); return NL_STOP; } -- cgit v1.2.3