mirror of
https://github.com/tmux/tmux.git
synced 2026-04-16 03:56:28 +00:00
Check for \0 after skipping # not before in format_expand1, from ossfuzz.
This commit is contained in:
2
format.c
2
format.c
@@ -5444,7 +5444,7 @@ format_expand1(struct format_expand_state *es, const char *fmt)
|
|||||||
buf[off++] = *fmt++;
|
buf[off++] = *fmt++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (*fmt++ == '\0')
|
if (*++fmt == '\0')
|
||||||
break;
|
break;
|
||||||
|
|
||||||
ch = (u_char)*fmt++;
|
ch = (u_char)*fmt++;
|
||||||
|
|||||||
@@ -3333,7 +3333,7 @@ window_copy_command(struct window_mode_entry *wme, struct client *c,
|
|||||||
enum window_copy_cmd_clear clear = WINDOW_COPY_CMD_CLEAR_NEVER;
|
enum window_copy_cmd_clear clear = WINDOW_COPY_CMD_CLEAR_NEVER;
|
||||||
const char *command;
|
const char *command;
|
||||||
u_int i, count = args_count(args);
|
u_int i, count = args_count(args);
|
||||||
int keys;
|
int keys, flags;
|
||||||
char *error = NULL;
|
char *error = NULL;
|
||||||
|
|
||||||
if (count == 0)
|
if (count == 0)
|
||||||
@@ -3355,9 +3355,10 @@ window_copy_command(struct window_mode_entry *wme, struct client *c,
|
|||||||
action = WINDOW_COPY_CMD_NOTHING;
|
action = WINDOW_COPY_CMD_NOTHING;
|
||||||
for (i = 0; i < nitems(window_copy_cmd_table); i++) {
|
for (i = 0; i < nitems(window_copy_cmd_table); i++) {
|
||||||
if (strcmp(window_copy_cmd_table[i].command, command) == 0) {
|
if (strcmp(window_copy_cmd_table[i].command, command) == 0) {
|
||||||
if (c->flags & CLIENT_READONLY &&
|
flags = window_copy_cmd_table[i].flags;
|
||||||
(~window_copy_cmd_table[i].flags &
|
if (c != NULL &&
|
||||||
WINDOW_COPY_CMD_FLAG_READONLY)) {
|
c->flags & CLIENT_READONLY &&
|
||||||
|
(~flags & WINDOW_COPY_CMD_FLAG_READONLY)) {
|
||||||
status_message_set(c, -1, 1, 0, 0,
|
status_message_set(c, -1, 1, 0, 0,
|
||||||
"client is read-only");
|
"client is read-only");
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user