diff options
author | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2003-12-20 18:33:42 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2003-12-20 18:33:42 +0000 |
commit | 23dbfcd00d655ddaecabf492d0ab6691f6e7d72c (patch) | |
tree | 36da3894bc7dc2ba80d765b8c1a3be62e5d19179 /lib/libusbhid/usage.c | |
parent | cdd18f79892d68eee65afb88d3377ad2d958f0b2 (diff) |
Fix unbounded scanf()'s. From Jared Yanovich. Ok tedu@.
Diffstat (limited to 'lib/libusbhid/usage.c')
-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++) |