From daa653fc2268ca99389ef2730abf5fe000eb7a37 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Mon, 11 Oct 2010 07:56:06 +0200 Subject: 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. --- include/osmocore/gsm0480.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include/osmocore') diff --git a/include/osmocore/gsm0480.h b/include/osmocore/gsm0480.h index ae92c1f9..94ac7174 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 @@ struct ussd_request { 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); -- cgit v1.2.3