diff options
author | 2003-12-20 18:33:41 +0000 | |
---|---|---|
committer | 2003-12-20 18:33:41 +0000 | |
commit | 88a81472663f2fb6a87d5843e60f0a88bc2e7e7f (patch) | |
tree | 85569bf8cacd92337ef048eb3d9e05b44dbd7e18 /lib | |
parent | keep track which process we are so fatal() can log in which proc the (diff) | |
download | wireguard-openbsd-88a81472663f2fb6a87d5843e60f0a88bc2e7e7f.tar.xz wireguard-openbsd-88a81472663f2fb6a87d5843e60f0a88bc2e7e7f.zip |
Fix unbounded scanf()'s. From Jared Yanovich. Ok tedu@.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libusbhid/usage.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/libusbhid/usage.c b/lib/libusbhid/usage.c index 67c9b113e49..5d0b2ee8b6a 100644 --- a/lib/libusbhid/usage.c +++ b/lib/libusbhid/usage.c @@ -1,4 +1,4 @@ -/* $OpenBSD: usage.c,v 1.4 2002/06/19 07:12:42 deraadt Exp $ */ +/* $OpenBSD: usage.c,v 1.5 2003/12/20 18:33:41 matthieu Exp $ */ /* $NetBSD: usage.c,v 1.1 2001/12/28 17:45:27 augustss Exp $ */ /* @@ -90,10 +90,10 @@ hid_init(const char *hidname) ; if (!*p) continue; - if (sscanf(line, " * %[^\n]", name) == 1) + if (sscanf(line, " * %99[^\n]", name) == 1) no = -1; - else if (sscanf(line, " 0x%x %[^\n]", &no, name) != 2 && - sscanf(line, " %d %[^\n]", &no, name) != 2) + else if (sscanf(line, " 0x%x %99[^\n]", &no, name) != 2 && + sscanf(line, " %d %99[^\n]", &no, name) != 2) errx(1, "file %s, line %d, syntax error", hidname, lineno); for (p = name; *p; p++) |