projects
/
u
/
mdw
/
putty
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
More sensible (and also more idiomatic) bounds checking on esc_args.
[u/mdw/putty]
/
terminal.c
diff --git
a/terminal.c
b/terminal.c
index
c0c809c
..
ba504d4
100644
(file)
--- a/
terminal.c
+++ b/
terminal.c
@@
-3290,8
+3290,8
@@
static void term_out(Terminal *term)
}
term->termstate = SEEN_CSI;
} else if (c == ';') {
}
term->termstate = SEEN_CSI;
} else if (c == ';') {
- if (
++term->esc_nargs <=
ARGS_MAX)
- term->esc_args[term->esc_nargs
- 1
] = ARG_DEFAULT;
+ if (
term->esc_nargs <
ARGS_MAX)
+ term->esc_args[term->esc_nargs
++
] = ARG_DEFAULT;
term->termstate = SEEN_CSI;
} else if (c < '@') {
if (term->esc_query)
term->termstate = SEEN_CSI;
} else if (c < '@') {
if (term->esc_query)