Commit 94730894 authored by Margit Schubert-While's avatar Margit Schubert-While Committed by Jeff Garzik

[PATCH] prism54 Fix wrong type for BSSID

2004-07-12 Margit Schubert-While <margitsw@t-online.de>

* The OID type for BSSID was incorrectly set to type SSID.
  It should be type RAW. This lead to interesting reporting
  by "iwpriv ethX g_bssid".
  (Which caused garbage output and possibly an out of bound)

* Be ultra-cautious in reporting SSID by changing the "%s"
  to "%.*s" and passing the length. (Prompted by the false
  type above, whereby length = 0 and a %s on a garbage field)
parent 95877f38
......@@ -62,7 +62,7 @@ struct oid_t isl_oid[] = {
/* 802.11 */
OID_U32_C(DOT11_OID_BSSTYPE, 0x10000000),
OID_STRUCT_C(DOT11_OID_BSSID, 0x10000001, u8[6], OID_TYPE_SSID),
OID_STRUCT_C(DOT11_OID_BSSID, 0x10000001, u8[6], OID_TYPE_RAW),
OID_STRUCT_C(DOT11_OID_SSID, 0x10000002, struct obj_ssid,
OID_TYPE_SSID),
OID_U32(DOT11_OID_STATE, 0x10000003),
......@@ -770,8 +770,9 @@ mgt_response_to_str(enum oid_num_t n, union oid_res_t *r, char *str)
case OID_TYPE_SSID:{
struct obj_ssid *ssid = r->ptr;
return snprintf(str, PRIV_STR_SIZE,
"length=%u\noctets=%s\n",
ssid->length, ssid->octets);
"length=%u\noctets=%.*s\n",
ssid->length, ssid->length,
ssid->octets);
}
break;
case OID_TYPE_KEY:{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment