mirror of
https://github.com/tmux/tmux.git
synced 2024-12-25 02:48:47 +00:00
Do not risk writing over the end of the buffer when it ends in #
(because strchr \0 will be non-NULL), reported by Robert Morris in GitHub issue 3610.
This commit is contained in:
parent
e79fb214f8
commit
ac43186dff
4
format.c
4
format.c
@ -3664,7 +3664,9 @@ format_skip(const char *s, const char *end)
|
|||||||
for (; *s != '\0'; s++) {
|
for (; *s != '\0'; s++) {
|
||||||
if (*s == '#' && s[1] == '{')
|
if (*s == '#' && s[1] == '{')
|
||||||
brackets++;
|
brackets++;
|
||||||
if (*s == '#' && strchr(",#{}:", s[1]) != NULL) {
|
if (*s == '#' &&
|
||||||
|
s[1] != '\0' &&
|
||||||
|
strchr(",#{}:", s[1]) != NULL) {
|
||||||
s++;
|
s++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user