ussd: Add a test case, switch parsing to use a gsm48_hdr and len
The current USSD code is not doing any size checks, add a test
case to find out how easily we access the data out of bounds.
Begin to use the length in some places.
diff --git a/include/osmocore/gsm0480.h b/include/osmocore/gsm0480.h
index ae92c1f..94ac717 100644
--- a/include/osmocore/gsm0480.h
+++ b/include/osmocore/gsm0480.h
@@ -2,6 +2,8 @@
#define gsm0480_h
#include "msgb.h"
+#include "protocol/gsm_04_08.h"
+#include "protocol/gsm_04_80.h"
#define MAX_LEN_USSD_STRING 31
@@ -11,7 +13,7 @@
uint8_t invoke_id;
};
-int gsm0480_decode_ussd_request(const struct msgb *msg,
+int gsm0480_decode_ussd_request(const struct gsm48_hdr *hdr, uint16_t len,
struct ussd_request *request);
struct msgb *gsm0480_create_unstructuredSS_Notify(int alertPattern, const char *text);