OSDN Git Service

tools/l2cap-tester: Fix NULL-dereference for tests with no data
authorJohan Hedberg <johan.hedberg@intel.com>
Thu, 12 Nov 2015 12:45:59 +0000 (14:45 +0200)
committerJohan Hedberg <johan.hedberg@intel.com>
Thu, 12 Nov 2015 12:45:59 +0000 (14:45 +0200)
tools/l2cap-tester.c

index 277be8c..3ffe283 100644 (file)
@@ -794,7 +794,7 @@ static void setup_powered_client(const void *test_data)
                bthost_set_connect_cb(bthost, send_rsp_new_conn, data);
        }
 
-       if (test->direct_advertising)
+       if (test && test->direct_advertising)
                mgmt_send(data->mgmt, MGMT_OP_SET_ADVERTISING,
                                data->mgmt_index, sizeof(param), param,
                                NULL, NULL, NULL);