diff options
| author | Srinivas Girigowda <sgirigow@codeaurora.org> | 2017-03-30 18:27:25 -0700 |
|---|---|---|
| committer | Sandeep Puligilla <spuligil@codeaurora.org> | 2017-04-03 15:53:10 -0700 |
| commit | f7e7a01da620f6afc9195b294cc356de9772133f (patch) | |
| tree | 692cca6a33d45073e30b956dc8c976f29a53a124 | |
| parent | dde052756b86d01b52fbb0ed0276d9d5a20daf4e (diff) | |
qcacld-3.0: Add zero to the end of the buffer
when wlan_mac.bin doesn’t end with ‘\0’,
get_next_line() can access the unexpected area.
Fix this by adding 0 to the end of the buffer.
Change-Id: I01971aa5ad9679338a19e837f73969367d5b08f8
CRs-Fixed: 2026925
| -rw-r--r-- | core/hdd/src/wlan_hdd_cfg.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c index 2f1fc63c2823..c1e6b801afe3 100644 --- a/core/hdd/src/wlan_hdd_cfg.c +++ b/core/hdd/src/wlan_hdd_cfg.c @@ -6062,7 +6062,7 @@ QDF_STATUS hdd_update_mac_config(hdd_context_t *pHddCtx) hdd_debug("wlan_mac.bin size %zu", fw->size); - temp = qdf_mem_malloc(fw->size); + temp = qdf_mem_malloc(fw->size + 1); if (temp == NULL) { hdd_err("fail to alloc memory"); @@ -6071,6 +6071,7 @@ QDF_STATUS hdd_update_mac_config(hdd_context_t *pHddCtx) } buffer = temp; qdf_mem_copy(buffer, fw->data, fw->size); + buffer[fw->size + 1] = 0x0; /* data format: * Intf0MacAddress=00AA00BB00CC |
