mirror of
https://github.com/tmux/tmux.git
synced 2026-10-06 17:49:52 +00:00
Do not loop forever if someone tries to give WCHAR_MAX a width, GitHub issue
5602.
This commit is contained in:
9
utf8.c
9
utf8.c
@@ -1,4 +1,4 @@
|
|||||||
/* $OpenBSD: utf8.c,v 1.72 2026/09/01 12:49:49 nicm Exp $ */
|
/* $OpenBSD: utf8.c,v 1.73 2026/09/20 08:11:00 nicm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2008 Nicholas Marriott <nicholas.marriott@gmail.com>
|
* Copyright (c) 2008 Nicholas Marriott <nicholas.marriott@gmail.com>
|
||||||
@@ -374,8 +374,13 @@ utf8_add_to_width_cache(const char *s)
|
|||||||
wc_end = wc_start;
|
wc_end = wc_start;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (wc = wc_start; wc <= wc_end; wc++)
|
wc = wc_start;
|
||||||
|
for (;;) {
|
||||||
utf8_insert_width_cache(wc, width);
|
utf8_insert_width_cache(wc, width);
|
||||||
|
if (wc == wc_end)
|
||||||
|
break;
|
||||||
|
wc++;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
utf8_no_width = 1;
|
utf8_no_width = 1;
|
||||||
ud = utf8_fromcstr(copy);
|
ud = utf8_fromcstr(copy);
|
||||||
|
|||||||
Reference in New Issue
Block a user