diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2018-02-25 17:11:18 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2018-02-25 17:11:18 +0100 |
commit | b2d79920255fc405b972e4c900e47f4a1046e044 (patch) | |
tree | b0ee1c462368b365880b6adb2fb8ea6b64b5336f /sys/src/9/ip/devip.c | |
parent | d3f4786a1fcfb3cf8eba0cad2457622c6487e0e9 (diff) |
kernel: properly handle bad attach specifiers
- only accept decimal for numeric device id's
- exclude negative device id's
- device id's out of range yield Enodev
Diffstat (limited to 'sys/src/9/ip/devip.c')
-rw-r--r-- | sys/src/9/ip/devip.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/src/9/ip/devip.c b/sys/src/9/ip/devip.c index 0437d59ed..2629c02ef 100644 --- a/sys/src/9/ip/devip.c +++ b/sys/src/9/ip/devip.c @@ -277,12 +277,12 @@ newipaux(char *owner, char *tag) static Chan* ipattach(char* spec) { - ulong dev; Chan *c; + ulong dev; - dev = strtoul(spec, nil, 0); + dev = strtoul(spec, nil, 10); if(dev >= Nfs) - error(Ebadspec); + error(Enodev); qlock(&fslock); if(ipfs[dev] == nil){ |