artulab
projects
/
openbsd
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0fcffb2
)
Clamp size to length if snprintf ever indicates overflow
author
deraadt
<deraadt@openbsd.org>
Wed, 5 Apr 2017 15:57:11 +0000
(15:57 +0000)
committer
deraadt
<deraadt@openbsd.org>
Wed, 5 Apr 2017 15:57:11 +0000
(15:57 +0000)
w/ millert
usr.bin/systat/engine.c
patch
|
blob
|
history
diff --git
a/usr.bin/systat/engine.c
b/usr.bin/systat/engine.c
index
2844f87
..
64cfc86
100644
(file)
--- a/
usr.bin/systat/engine.c
+++ b/
usr.bin/systat/engine.c
@@
-1,4
+1,4
@@
-/* $Id: engine.c,v 1.2
0 2017/04/05 04:44:03
deraadt Exp $ */
+/* $Id: engine.c,v 1.2
1 2017/04/05 15:57:11
deraadt Exp $ */
/*
* Copyright (c) 2001, 2007 Can Erkin Acar <canacar@openbsd.org>
*
@@
-347,6
+347,8
@@
print_bar_title(field_def *fld)
}
len = snprintf(buf, sizeof(buf), "%d\\", val);
+ if (len >= sizeof(buf))
+ len = strlen(buf);
while (cur < pos - len) {
tbprintf(" ");
cur++;