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:
Eytan Lifshitz 2014-01-28 09:32:34 +02:00 committed by Jouni Malinen
parent 4b0f2282cb
commit fd67275b85

View file

@ -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;
} }