From 46cd7fa4bb5e3536628c6e645b1e7eecf53c0b0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Narajowski?= Date: Fri, 7 Jul 2017 17:04:06 +0200 Subject: [PATCH] nimble/controller: fix null pointer dereference X-Original-Commit: 8052a2202d5672b6aebd4a760e6253732262ac05 --- nimble/controller/src/ble_ll_scan.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nimble/controller/src/ble_ll_scan.c b/nimble/controller/src/ble_ll_scan.c index 2152c731a..ef77f52ef 100644 --- a/nimble/controller/src/ble_ll_scan.c +++ b/nimble/controller/src/ble_ll_scan.c @@ -1510,14 +1510,15 @@ ble_ll_scan_get_aux_data(struct ble_ll_scan_sm *scansm, if (scansm->cur_aux_data) { /* If we are here that means there is chain advertising. */ + /* Lets reuse old aux_data */ + *aux_data = scansm->cur_aux_data; + /* TODO Collision; Do smth smart when did does not match */ if (tmp_aux_data.did != (*aux_data)->did) { STATS_INC(ble_ll_stats, aux_chain_err); (*aux_data)->flags |= BLE_LL_AUX_INCOMPLETE_ERR_BIT; } - /* Lets reuse old aux_data */ - *aux_data = scansm->cur_aux_data; (*aux_data)->flags |= BLE_LL_AUX_CHAIN_BIT; (*aux_data)->flags |= BLE_LL_AUX_INCOMPLETE_BIT; } else if (ble_ll_scan_ext_adv_init(aux_data) < 0) {