wpa_supplicant: Fix wrong size memory allocation
Fix memory allocation in wpa_scan_clone_params(), where the allocation request used the size of a pointer rather than the size of the structure. Signed-hostap: Eytan Lifshitz <eytan.lifshitz@intel.com>
This commit is contained in:
parent
4b0f2282cb
commit
fd67275b85
1 changed files with 3 additions and 2 deletions
|
@ -1765,12 +1765,13 @@ wpa_scan_clone_params(const struct wpa_driver_scan_params *src)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (src->filter_ssids) {
|
if (src->filter_ssids) {
|
||||||
params->filter_ssids = os_malloc(sizeof(params->filter_ssids) *
|
params->filter_ssids = os_malloc(sizeof(*params->filter_ssids) *
|
||||||
src->num_filter_ssids);
|
src->num_filter_ssids);
|
||||||
if (params->filter_ssids == NULL)
|
if (params->filter_ssids == NULL)
|
||||||
goto failed;
|
goto failed;
|
||||||
os_memcpy(params->filter_ssids, src->filter_ssids,
|
os_memcpy(params->filter_ssids, src->filter_ssids,
|
||||||
sizeof(params->filter_ssids) * src->num_filter_ssids);
|
sizeof(*params->filter_ssids) *
|
||||||
|
src->num_filter_ssids);
|
||||||
params->num_filter_ssids = src->num_filter_ssids;
|
params->num_filter_ssids = src->num_filter_ssids;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue