[PATCH v2 1/3] util: ensure decode_hex_own_buf is passed a valid buffer
"Sicelo A. Mhlongo" <[email protected]> Tue, 17 Dec 2024 11:31:27 +0200
| Newsgroups | dev.linux.lists.ofono |
|---|---|
| Message-ID | <[email protected]> |
--- src/util.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/util.c b/src/util.c index 53d55d7e..bfe46ef2 100644 --- a/src/util.c +++ b/src/util.c @@ -3181,6 +3181,9 @@ unsigned char *decode_hex_own_buf(const char *in, long len, long *items_written, char c; unsigned char b; + if (!buf) + return NULL; + if (len < 0) len = strlen(in); -- 2.45.2