mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-20 05:33:47 -04:00
url-mode: regex: don't try to NULL-terminate an invalid vline
This commit is contained in:
parent
970d95c5a1
commit
c63202ee0e
1 changed files with 4 additions and 1 deletions
|
|
@ -389,8 +389,11 @@ regex_detected(const struct terminal *term, enum url_action action,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Terminate the last line, if necessary */
|
/* Terminate the last line, if necessary */
|
||||||
if (vline->len > 0 && vline->utf8[vline->len - 1] != '\0')
|
if (vline_idx < ALEN(vlines) &&
|
||||||
|
vline->len > 0 && vline->utf8[vline->len - 1] != '\0')
|
||||||
|
{
|
||||||
vline->utf8[vline->len++] = '\0';
|
vline->utf8[vline->len++] = '\0';
|
||||||
|
}
|
||||||
|
|
||||||
for (size_t i = 0; i < ALEN(vlines); i++) {
|
for (size_t i = 0; i < ALEN(vlines); i++) {
|
||||||
const struct vline *v = &vlines[i];
|
const struct vline *v = &vlines[i];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue