From: Mattias A. <mat...@us...> - 2001-05-02 15:38:55
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- sdp.c 1.74 1.75=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * fixed bug in get_free_sdp_con, was trying to access beyond end of array= =20 if all sdp cons where busy * replaced hardcoded values with define =20 The diff of the modified file(s): --- sdp.c 2001/04/17 10:00:26 1.74 +++ sdp.c 2001/05/02 15:38:54 1.75 @@ -300,7 +300,7 @@ u8 query[256]; } database_query; =20 -sdp_con sdp_con_list[7]; +sdp_con sdp_con_list[MAX_NBR_SDP]; =20 static int role; =20 @@ -378,7 +378,7 @@ /* Register SDP in the L2AP layer*/ l2cap_register_upper(SDP_LAYER, &this_layer);=20 =20 - for (i =3D 0; i < 7; i++) { + for (i =3D 0; i < MAX_NBR_SDP; i++) { sdp_con_list[i].id =3D i; sdp_con_list[i].l2cap =3D NULL; sdp_con_list[i].state =3D SDP_DISCONNECTED; @@ -1056,13 +1056,15 @@ { s32 i =3D 0; =20 - while ((i < 7) && (sdp_con_list[i].state !=3D SDP_DISCONNECTED)) { + while ((i < MAX_NBR_SDP) &&=20 + (sdp_con_list[i].state !=3D SDP_DISCONNECTED)) { i++; } =20 - if ((i =3D=3D 7) && (sdp_con_list[i].state !=3D SDP_DISCONNECTED)) { + if (i =3D=3D MAX_NBR_SDP) { return 0; } + return &sdp_con_list[i]; } =20 |