From: Slava Monich <slava.monich@jolla.com>
To: ofono@ofono.org
Subject: [PATCH] simutil: Fill unused part of AID with FFs
Date: Thu, 29 Apr 2021 19:09:21 +0300 [thread overview]
Message-ID: <20210429160921.3153725-1-slava.monich@jolla.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 590 bytes --]
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(+)
diff --git a/src/simutil.c b/src/simutil.c
index 5d2aa6a2..e648c918 100644
--- a/src/simutil.c
+++ b/src/simutil.c
@@ -1588,6 +1588,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];
--
2.25.1
next reply other threads:[~2021-04-29 16:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-29 16:09 Slava Monich [this message]
2021-04-30 14:54 ` [PATCH] simutil: Fill unused part of AID with FFs Denis Kenzior
2021-05-01 22:39 ` Slava Monich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210429160921.3153725-1-slava.monich@jolla.com \
--to=slava.monich@jolla.com \
--cc=ofono@ofono.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).