public
/
ack.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6a4f465
)
Fix buffer overrun: if LABEL_STARTER is seen but LABEL_TERMINATOR is not, the
author
David Given
<dg@cowlark.com>
Sun, 13 Nov 2016 13:04:58 +0000
(14:04 +0100)
committer
David Given
<dg@cowlark.com>
Sun, 13 Nov 2016 13:04:58 +0000
(14:04 +0100)
label parser will keep going forever looking for the end of the label. It now
stops at the end of the string.
mach/proto/top/top.c
patch
|
blob
|
history
diff --git
a/mach/proto/top/top.c
b/mach/proto/top/top.c
index
178dd45
..
5d57fa1
100644
(file)
--- a/
mach/proto/top/top.c
+++ b/
mach/proto/top/top.c
@@
-330,7
+330,7
@@
labeldef(ip)
int oplen;
p = ip->rest_line;
- while(
*p != LABEL_TERMINATOR
) p++;
+ while(
*p && (*p != LABEL_TERMINATOR)
) p++;
oplen = p - ip->rest_line;
if (oplen == 0 || oplen > MAXOPLEN) return;
strncpy(ip->op[0],ip->rest_line,oplen);