mirror of
https://github.com/systemd/systemd.git
synced 2024-12-26 03:22:00 +03:00
devnum-util: catch potential stack overruns early
This commit is contained in:
parent
ec61371fe6
commit
02b9047edf
@ -18,6 +18,8 @@ int parse_devnum(const char *s, dev_t *ret) {
|
||||
n = strspn(s, DIGITS);
|
||||
if (n == 0)
|
||||
return -EINVAL;
|
||||
if (n > DECIMAL_STR_MAX(dev_t))
|
||||
return -EINVAL;
|
||||
if (s[n] != ':')
|
||||
return -EINVAL;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user