mirror of
https://github.com/tmux/tmux.git
synced 2024-12-13 18:38:48 +00:00
Do not write after the end of the array and overwrite the stack when
colon-separated SGR sequences contain empty arguments. Reported by Sergey Nizovtsev.
This commit is contained in:
parent
7a4aa14618
commit
733abfcfc5
7
input.c
7
input.c
@ -1975,8 +1975,13 @@ input_csi_dispatch_sgr_colon(struct input_ctx *ictx, u_int i)
|
|||||||
free(copy);
|
free(copy);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else
|
} else {
|
||||||
n++;
|
n++;
|
||||||
|
if (n == nitems(p)) {
|
||||||
|
free(copy);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
log_debug("%s: %u = %d", __func__, n - 1, p[n - 1]);
|
log_debug("%s: %u = %d", __func__, n - 1, p[n - 1]);
|
||||||
}
|
}
|
||||||
free(copy);
|
free(copy);
|
||||||
|
Loading…
Reference in New Issue
Block a user