FM: OOB Write & Read Fix
Out of Buffer Write and Read fixes for FM
Change-Id: I9b8e6158d51ca14fb24dfd002ccf0e15a0247df7
diff --git a/helium/radio-helium.h b/helium/radio-helium.h
index d3dae68..4de9213 100644
--- a/helium/radio-helium.h
+++ b/helium/radio-helium.h
@@ -619,7 +619,7 @@
struct hci_ev_af_list {
int tune_freq;
short pi_code;
- char af_size;
+ uint8_t af_size;
char af_list[FM_AF_LIST_MAX_SIZE];
} __attribute__((packed)) ;
@@ -693,7 +693,7 @@
} __attribute__((packed));
struct hci_fm_data_rd_rsp {
- char data_len;
+ uint8_t data_len;
char data[DEFAULT_DATA_SIZE];
} ;
@@ -755,6 +755,8 @@
#define AF_SIZE_OFFSET 6
#define AF_LIST_OFFSET 7
#define RT_A_B_FLAG_OFFSET 4
+#define RDS_PS_NUMBER_MIN 1
+#define RDS_PS_NUMBER_MAX 12
/*FM states*/
enum radio_state_t {