qcacmn: Fix potential NULL dereference in P2P

1) Check for validity of ps_config before dereferencing.
2) Check for validity of lo_start before dereferencing.
3) Initialize tmp_p2p_ie before using it.

Change-Id: I4cd5bcb025e63d727e5535921a4e4121d618ee36
CRs-Fixed: 2160760
This commit is contained in:
Varun Reddy Yeturu
2018-01-04 16:25:06 -08:00
committed by snandini
parent 3488bf405f
commit 27f023ad59

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2017 The Linux Foundation. All rights reserved. * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved.
* *
* Permission to use, copy, modify, and/or distribute this software for * Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the * any purpose with or without fee is hereby granted, provided that the
@@ -142,7 +142,7 @@ static const uint8_t *p2p_get_p2pie_from_probe_rsp(
{ {
const uint8_t *ie; const uint8_t *ie;
const uint8_t *p2p_ie; const uint8_t *p2p_ie;
const uint8_t *tmp_p2p_ie; const uint8_t *tmp_p2p_ie = NULL;
uint16_t ie_len; uint16_t ie_len;
if (tx_ctx->buf_len <= PROBE_RSP_IE_OFFSET) { if (tx_ctx->buf_len <= PROBE_RSP_IE_OFFSET) {