From: Jouni Malinen Date: Thu, 6 Sep 2012 21:15:53 +0000 (+0300) Subject: Make copies basic_rates list more useful X-Git-Tag: hostap_2_0~250 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f0898e95194201ddb49575845a1ec156c66ad3c3;p=thirdparty%2Fhostap.git Make copies basic_rates list more useful Commit e5693c4775bae65faa960f80889f98b0a6cb2e1c added a copy of the determined basic rate set into struct hostapd_iface, but did not actually copy the terminating -1 value. This could be problematic if something were to actually try to use this list since would be no way to know what is the last entry in the list. Fix this by copying the terminating value. Signed-hostap: Jouni Malinen --- diff --git a/src/ap/hw_features.c b/src/ap/hw_features.c index 76aff7750..97e1238e6 100644 --- a/src/ap/hw_features.c +++ b/src/ap/hw_features.c @@ -129,6 +129,8 @@ int hostapd_prepare_rates(struct hostapd_iface *iface, i = 0; while (basic_rates[i] >= 0) i++; + if (i) + i++; /* -1 termination */ os_free(iface->basic_rates); iface->basic_rates = os_malloc(i * sizeof(int)); if (iface->basic_rates)