Skip to content

lib/string_helpers: fixes and test cases for string_unescape()

Jonas Rebmann linux-hardening lkml 1 version In review

Get series with b4
b4 am [email protected] change-id 20260915-string_unescape-c056aacc90cb

Versions newest first

  1. v1 Latest5 patches 19 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5lib/tests: string_helpers: check null terminator toolib/tests/string_helpers_kunit.c+2 -13 replies
2/5lib/tests: string_helpers: drop unused parameterslib/tests/string_helpers_kunit.c+2 -52 replies
3/5lib/tests: string_helpers: introduce test_string_unescape_onelib/tests/string_helpers_kunit.c+25 -65 replies
4/5lib/string_helpers: use full destination buffer in string_unescape()lib/string_helpers.c lib/tests/string_helpers_kunit.c+4 -15 replies
5/5lib/string_helpers: fix counting of remaining bytes in string_unescape()lib/string_helpers.c lib/tests/string_helpers_kunit.c+5 -21 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/5] lib/string_helpers: fixes and test cases for string_unescape()

This series fixes two bugs in string_unescape() regarding the destination buffer length. Both fixes are accompanied with kunit tests which would fail without the fixes.

To make this possible, preparatory patches 1 and 2 improve and clean up testing helpers and 3 introduces test_unescape_one() which allows for targeted testing of the string_unescape() function.

---
Jonas Rebmann (5):
lib/tests: string_helpers: check null terminator too lib/tests: string_helpers: drop unused parameters lib/tests: string_helpers: introduce test_string_unescape_one lib/string_helpers: use full destination buffer in string_unescape() lib/string_helpers: fix counting of remaining bytes in string_unescape()

 lib/string_helpers.c             |  5 +++--
 lib/tests/string_helpers_kunit.c | 46 +++++++++++++++++++++++++++++-----------
 2 files changed, 37 insertions(+), 14 deletions(-)

---
base-commit: 587858367581b9c55c3690f4e63382ad622719d4
change-id: 20260915-string_unescape-c056aacc90cb

Best regards,

Signature · 1 line
Jonas Rebmann <[email protected]>