diff mbox series

[v2,1/3] util: ensure decode_hex_own_buf is passed a valid buffer

Message ID 20241217093207.20636-1-absicsz@gmail.com (mailing list archive)
State Accepted
Commit 1e2a768445aecfa0a0e9c788651a9205cfd3744f
Headers show
Series [v2,1/3] util: ensure decode_hex_own_buf is passed a valid buffer | expand

Commit Message

Sicelo Dec. 17, 2024, 9:31 a.m. UTC
---
 src/util.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

patchwork-bot+ofono@kernel.org Dec. 17, 2024, 5:20 p.m. UTC | #1
Hello:

This series was applied to ofono.git (master)
by Denis Kenzior <denkenz@gmail.com>:

On Tue, 17 Dec 2024 11:31:27 +0200 you wrote:
> ---
>  src/util.c | 3 +++
>  1 file changed, 3 insertions(+)

Here is the summary with links:
  - [v2,1/3] util: ensure decode_hex_own_buf is passed a valid buffer
    https://git.kernel.org/pub/scm/network/ofono/ofono.git/?id=1e2a768445ae
  - [v2,2/3] atmodem: sms: ensure buffer is initialized before use
    https://git.kernel.org/pub/scm/network/ofono/ofono.git/?id=29ff6334b492
  - [v2,3/3] ussd: ensure ussd content fits in buffers
    https://git.kernel.org/pub/scm/network/ofono/ofono.git/?id=389e2344f863

You are awesome, thank you!
diff mbox series

Patch

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);