Message ID | 20240823161553.479576-5-denkenz@gmail.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | [1/6] netlink: Add l_netlink_iter | expand |
Context | Check | Description |
---|---|---|
tedd_an/pre-ci_am | success | Success |
diff --git a/ell/util.c b/ell/util.c index 45ec6c8110bc..f474098c082b 100644 --- a/ell/util.c +++ b/ell/util.c @@ -760,6 +760,9 @@ static int safe_atou(const char *s, int base, unsigned int *out_u) LIB_EXPORT int l_safe_atou32(const char *s, uint32_t *out_u) { + if (unlikely(!s)) + return -EINVAL; + if (!l_ascii_isdigit(s[0])) return -EINVAL; @@ -808,6 +811,9 @@ LIB_EXPORT int l_safe_atox16(const char *s, uint16_t *out_x) LIB_EXPORT int l_safe_atox32(const char *s, uint32_t *out_x) { + if (unlikely(!s)) + return -EINVAL; + if (!l_ascii_isxdigit(s[0])) return -EINVAL;