From 8b4e79b443ee20d287bb68ae3a02c1819fd1b2d5 Mon Sep 17 00:00:00 2001 From: Slava Monich Date: Thu, 29 Apr 2021 19:09:21 +0300 Subject: simutil: Fill unused part of AID with FFs Correct handling of short AIDs will take more than that, but leaving part of the array uninitialized is wrong in any case. --- src/simutil.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/simutil.c b/src/simutil.c index 9013460e..edd7de88 100644 --- a/src/simutil.c +++ b/src/simutil.c @@ -1589,6 +1589,7 @@ GSList *sim_parse_app_template_entries(const unsigned char *buffer, int len) goto error; memcpy(app.aid, aid, app.aid_len); + memset(app.aid + app.aid_len, 0xff, 16 - app.aid_len); app.type = (app.aid[5] << 8) | app.aid[6]; -- cgit v1.2.1