Do not leak trimmed string when expanding, found by ossfuzz.

This commit is contained in:
nicm
2026-04-02 09:35:46 +00:00
parent be2c6f3b5e
commit c95d341220
2 changed files with 3 additions and 1 deletions

View File

@@ -1116,7 +1116,7 @@ format_width(const char *expanded)
/*
* Trim on the left, taking #[] into account. Note, we copy the whole set of
* unescaped #s, but only add their escaped size to width. This is because the
* format_draw function will actually do the escaping when it runs
* format_draw function will actually do the escaping.
*/
char *
format_trim_left(const char *expanded, u_int limit)