Skip to contentSkip to conversation

Staging: rtl8192e: printing the wrong array

PATCH New Dan Carpenter 1 participant 1 message May 29, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 2/2 Staging: rtl8192e: printing the wrong array

Smatch complained that there is an array overflow here. It looks like we are supposed to be printing the ->rates_ex[] array which is slightly larger than the ->rates[] array. This is a cut and paste error.

drivers/staging/rtl8192e/rtllib_rx.c +1 -1
index 8b8a5c6..e75364e 100644
@@ -1822,7 +1822,7 @@ int rtllib_parse_info_param(struct rtllib_device *ieee,
 				network->rates_ex[i] = info_element->data[i];
 				p += snprintf(p, sizeof(rates_str) -
 					      (p - rates_str), "%02X ",
-					      network->rates[i]);
+					      network->rates_ex[i]);
 				if (rtllib_is_ofdm_rate
 				    (info_element->data[i])) {
 					network->flags |= NETWORK_HAS_OFDM;