Skip to content

string: strl(cat|cpy)

Sean Anderson u-boot 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest5 patches 0 repliesNew

Changes in v2 from the cover letter

- Fix strlcpy return value
- Add implementation of strlcat
- Add test for strlcat
- Fix bug in fastboot
- Move check to u_boot_line

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5lib: string: Fix strlcpy return valuelib/string.c+8 -42 replies
1/5lib: string: Fix strlcpy return value+0 -00 replies
1/5lib: string: Fix strlcpy return value+0 -01 reply
2/5lib: string: Implement strlcatdrivers/usb/dwc3/linux-compat.h include/linux/string.h lib/string.c+22 -62 replies
3/5test: Add test for strlcattest/lib/Makefile test/lib/strlcat.c+127 -02 replies
4/5fastboot: Fix possible buffer overrundrivers/fastboot/fb_mmc.c+3 -31 reply
5/5checkpatch: Add warnings for using strn(cat|cpy)scripts/checkpatch.pl tools/patman/test_checkpatch.py+19 -12 replies

Reviews trailers per patch

3 of 7 patches have a Reviewed-by or Acked-by.

PatchSimon Glass
1/5
1/5
1/5
2/5R-b
3/5R-b
4/5
5/5R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/5] string: strl(cat|cpy)

This series adds support for strl(cat|cpy), and brings their implementations in-line with what is documented in the Linux man pages. It also fixes some potential (actual) fastboot bugs. Lastly, it adds a patman check to suggest using these functions over strn(cat|cpy). I think these functions provide a much better interface, which removes some footguns from U-Boot.

Changes in v2:
- Fix strlcpy return value
- Add implementation of strlcat
- Add test for strlcat
- Fix bug in fastboot
- Move check to u_boot_line

Sean Anderson (5):
lib: string: Fix strlcpy return value
lib: string: Implement strlcat
test: Add test for strlcat
fastboot: Fix possible buffer overrun
checkpatch: Add warnings for using strn(cat|cpy)

 drivers/fastboot/fb_mmc.c       |   6 +-
 drivers/usb/dwc3/linux-compat.h |   6 --
 include/linux/string.h          |   3 +
 lib/string.c                    |  31 +++++++-
 scripts/checkpatch.pl           |   6 ++
 test/lib/Makefile               |   1 +
 test/lib/strlcat.c              | 126 ++++++++++++++++++++++++++++++++
 tools/patman/test_checkpatch.py |  14 +++-
 8 files changed, 179 insertions(+), 14 deletions(-)
 create mode 100644 test/lib/strlcat.c
Signature · 1 line
2.30.1