From 67d1ddc22a9ce718e550db8f30ad4ab2a61e1695 Mon Sep 17 00:00:00 2001 From: Jeevaka Badrappan Date: Thu, 20 Jan 2011 14:52:55 +0200 Subject: [PATCH] stkutil: add check for qualifier and browser id Checks the valid qualifier and browser id values applicable for launch browser proactive command --- src/stkutil.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/stkutil.c b/src/stkutil.c index b7f03e2..abd1c99 100644 --- a/src/stkutil.c +++ b/src/stkutil.c @@ -1187,7 +1187,11 @@ static gboolean parse_dataobj_browser_id(struct comprehension_tlv_iter *iter, void *user) { unsigned char *byte = user; - return parse_dataobj_common_byte(iter, byte); + + if (parse_dataobj_common_byte(iter, byte) == FALSE || *byte > 4) + return FALSE; + + return TRUE; } /* Defined in TS 102.223 Section 8.48 */ @@ -3229,6 +3233,9 @@ static enum stk_command_parse_result parse_launch_browser( { struct stk_command_launch_browser *obj = &command->launch_browser; + if (command->qualifier > 3 || command->qualifier == 1) + return STK_PARSE_RESULT_DATA_NOT_UNDERSTOOD; + if (command->src != STK_DEVICE_IDENTITY_TYPE_UICC) return STK_PARSE_RESULT_DATA_NOT_UNDERSTOOD; -- 2.7.4