Rajaram-Regupathy / libtypec

“libtypec” is aimed to provide a generic interface abstracting all platform complexity for user space to develop tools for efficient USB-C port management. The library can also enable development of diagnostic and debug tools to debug system issues around USB-C/USB PD topology.
34 stars 4 forks source link

Potential negative index read in array bb_data[] in function typec_status_billboard() #29

Closed ColinIanKing closed 6 months ago

ColinIanKing commented 9 months ago

In utils/typecstatus.c, function typec_status_billboard() function find_bb_bos_index() can potentially return -1 if the find fails, causing a negative index read in the array bb_data[]

                bb_loc = find_bb_bos_index(bb_data,ret);

                struct bb_bos_descritor *bb_bos_desc = (struct bb_bos_descritor *)&bb_data[bb_loc];
Rajaram-Regupathy commented 6 months ago

solved