[PATCH 3/4] Fix CVE-2024-7547
Ivaylo Dimitrov <[email protected]>
| Newsgroups | dev.linux.lists.ofono |
|---|---|
| Message-ID | <[email protected]> |
--- src/smsutil.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/smsutil.c b/src/smsutil.c index 8f578c22..484bfd0b 100644 --- a/src/smsutil.c +++ b/src/smsutil.c @@ -1464,6 +1464,9 @@ static gboolean decode_command(const unsigned char *pdu, int len, if ((len - offset) < out->command.cdl) return FALSE; + if (out->command.cdl > sizeof(out->command.cd)) + return FALSE; + memcpy(out->command.cd, pdu + offset, out->command.cdl); return TRUE; -- 2.17.1