diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2025-02-10 12:09:07 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2025-02-10 12:09:07 +0000 |
| commit | c63202ee0ee45182ec5ab440262e63b85104e59e (patch) | |
| tree | 883bfa9896d187e5cdf31b624d75979829927b90 /url-mode.c | |
| parent | doc: foot.ini: fix 'hashes' regex example (diff) | |
url-mode: regex: don't try to NULL-terminate an invalid vline
Diffstat (limited to 'url-mode.c')
| -rw-r--r-- | url-mode.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -389,8 +389,11 @@ regex_detected(const struct terminal *term, enum url_action action, } /* 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'; + } for (size_t i = 0; i < ALEN(vlines); i++) { const struct vline *v = &vlines[i]; |
