projects
/
oweals
/
busybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ee777c4
)
nmeter: fix read past the end if a buffer. Closes 4594
author
Denis Vlasenko
<vda.linux@googlemail.com>
Thu, 14 Aug 2008 21:57:43 +0000
(21:57 -0000)
committer
Denis Vlasenko
<vda.linux@googlemail.com>
Thu, 14 Aug 2008 21:57:43 +0000
(21:57 -0000)
procps/nmeter.c
patch
|
blob
|
history
diff --git
a/procps/nmeter.c
b/procps/nmeter.c
index 48a5b4e26dfbb60af6377ab640d581d68b3d87d8..cded67e562868643a4757d43ea29cbfeb9f43e07 100644
(file)
--- a/
procps/nmeter.c
+++ b/
procps/nmeter.c
@@
-786,8
+786,10
@@
int nmeter_main(int argc, char **argv)
if (argc != 2)
bb_show_usage();
- if (open_read_close("version", buf, sizeof(buf)) > 0)
- is26 = (strstr(buf, " 2.4.")==NULL);
+ if (open_read_close("version", buf, sizeof(buf)-1) > 0) {
+ buf[sizeof(buf)-1] = '\0';
+ is26 = (strstr(buf, " 2.4.") == NULL);
+ }
// Can use argv[1] directly, but this will mess up
// parameters as seen by e.g. ps. Making a copy...