Chris Down
0a66431031
string-util: Prevent infinite loop pegging CPU on malformed ESC input
...
string_has_ansi_sequence() currently does this to look for ESC input:
t = memchr(s, 0x1B, ...)
So each iteration re-searches from the original start pointer. But if we
find an ESC byte that does *not* start a valid ANSI sequence (like "\x1B
", or an ESC at the end of the string), then ansi_sequence_length()
returns 0, and if that ESC is still in the search window, we will just
spin consuming 100% CPU forever.
Fix this by always advancing past rejected ESC bytes.
2026-02-14 21:49:24 +01:00
..
2026-01-21 15:09:46 +01:00
2026-02-03 08:16:25 +09:00
2025-12-15 08:50:13 +09:00
2026-02-14 21:49:24 +01:00
2025-12-15 08:50:13 +09:00
2026-01-16 23:05:33 +09:00
2026-01-20 11:09:27 +09:00
2026-02-05 14:14:38 +01:00
2026-02-11 14:25:36 +01:00
2026-01-19 22:41:33 +09:00
2025-11-17 21:31:51 +09:00
2026-02-11 11:46:12 +01:00
2026-02-13 16:56:59 +01:00
2025-12-20 15:50:47 +01:00
2025-11-24 13:09:41 +01:00
2026-02-11 11:47:59 +01:00
2026-01-19 17:49:39 +01:00
2025-12-15 08:50:13 +09:00
2025-12-20 15:50:47 +01:00
2026-02-13 17:18:33 +01:00
2026-01-16 23:05:33 +09:00
2025-12-10 18:59:44 +09:00
2025-12-15 08:50:13 +09:00
2026-02-03 13:21:03 +01:00
2025-12-20 15:50:47 +01:00
2025-12-15 08:50:13 +09:00
2026-02-10 21:54:12 +01:00
2025-12-15 08:50:13 +09:00
2025-12-15 08:50:13 +09:00
2025-12-15 08:50:13 +09:00
2025-12-15 08:50:13 +09:00
2025-12-15 08:50:13 +09:00
2026-02-14 04:58:50 +09:00
2026-01-23 17:50:44 +01:00
2026-02-14 04:58:50 +09:00
2026-02-05 14:14:39 +01:00
2026-01-12 22:17:36 +01:00
2026-02-09 13:51:59 +01:00
2026-02-11 11:48:29 +01:00
2026-02-09 10:21:16 +01:00
2025-12-18 13:57:32 +01:00
2026-01-28 10:56:53 +09:00
2026-02-13 19:34:45 +00:00
2026-02-04 10:34:30 +01:00
2026-01-02 09:39:31 +01:00
2026-01-03 06:00:30 +09:00
2026-02-13 14:51:44 +01:00
2026-02-11 14:25:36 +01:00
2025-12-15 08:50:13 +09:00
2025-12-15 08:50:13 +09:00
2026-01-16 23:05:33 +09:00
2026-02-11 11:46:44 +01:00
2026-02-09 10:33:01 +01:00
2026-02-11 11:24:37 +01:00
2025-12-20 15:50:47 +01:00
2026-02-13 11:07:22 +01:00
2026-02-05 16:39:28 +01:00
2025-11-05 01:33:31 +09:00
2025-12-18 10:53:27 +01:00
2026-01-04 18:01:36 +01:00
2026-02-09 02:05:57 +01:00
2026-02-11 11:47:18 +01:00
2025-12-15 08:50:13 +09:00
2026-02-11 14:25:36 +01:00
2026-02-13 11:40:11 +01:00
2026-01-06 08:45:22 +09:00
2025-12-20 15:50:47 +01:00
2026-01-02 20:08:41 +01:00
2026-01-02 20:08:41 +01:00
2026-02-13 16:50:45 +09:00
2026-02-11 15:31:37 +01:00
2026-02-14 04:58:50 +09:00
2026-02-03 15:00:32 +01:00
2025-12-15 08:50:13 +09:00
2026-01-20 15:54:55 +01:00
2026-02-13 10:21:44 +01:00
2026-01-18 19:15:30 +01:00
2026-02-05 10:28:47 +01:00
2026-01-02 20:08:41 +01:00
2025-12-15 08:50:13 +09:00
2026-02-13 11:40:11 +01:00
2025-11-13 21:28:17 +01:00
2026-01-30 15:36:03 +09:00
2025-12-20 15:50:47 +01:00
2026-01-16 23:05:33 +09:00
2026-02-11 14:25:36 +01:00
2026-02-09 11:01:15 +01:00
2026-02-11 11:24:37 +01:00
2026-02-13 15:46:52 +09:00
2026-01-20 15:54:55 +01:00
2026-02-14 21:49:24 +01:00
2026-01-16 23:05:33 +09:00
2025-12-15 08:50:13 +09:00
2026-02-05 14:14:40 +01:00
2026-01-16 23:05:33 +09:00
2026-01-02 20:08:41 +01:00
2026-02-14 05:41:01 +09:00
2026-01-06 04:44:43 +09:00
2025-12-15 08:50:13 +09:00
2026-02-11 14:25:36 +01:00
2026-01-13 10:21:05 +09:00
2026-02-13 19:07:20 +01:00
2025-12-20 15:50:47 +01:00
2026-01-02 11:15:17 +09:00
2025-12-01 16:18:11 +01:00
2026-02-04 11:43:22 +09:00
2025-12-15 08:50:13 +09:00
2026-01-16 13:07:47 +01:00
2025-12-15 08:50:13 +09:00