summaryrefslogtreecommitdiffstats
path: root/src/simutil.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/simutil.c')
-rw-r--r--src/simutil.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/simutil.c b/src/simutil.c
index c9188468..0ff93a23 100644
--- a/src/simutil.c
+++ b/src/simutil.c
@@ -687,7 +687,10 @@ gboolean sim_parse_2g_get_response(unsigned char *response, int len,
int *file_len, int *record_len,
int *structure, unsigned char *access)
{
- if (len < 14)
+ if (len < 14 || response[6] != 0x04)
+ return FALSE;
+
+ if ((response[13] == 0x01 || response[13] == 0x03) && len < 15)
return FALSE;
*file_len = (response[2] << 8) | response[3];