Skip to content

strlcpy() and strlcat() for iproute2

Phil Sutter netdev 1 version Applied

Status from this message: Applied, thanks.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 7 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/6utils: Implement strlcpy() and strlcat()include/utils.h lib/utils.c+22 -06 replies
2/6Convert the obvious cases to strlcpy()ip/ipnetns.c ip/iproute_lwtunnel.c ip/ipvrf.c +5 more+8 -161 reply
3/6Convert harmful calls to strncpy() to strlcpy()genl/ctrl.c ip/ipvrf.c ip/xfrm_state.c+3 -30 replies
4/6ipxfrm: Replace STRBUF_CAT macro with strlcat()ip/ipxfrm.c+5 -160 replies
5/6tc_util: No need to terminate an snprintf'ed buffertc/tc_util.c+0 -10 replies
6/6lnstat_util: Make sure buffer is NUL-terminatedmisc/lnstat_util.c+2 -10 replies

Reviews trailers per patch

1 of 6 patches has a Reviewed-by or Acked-by.

PatchDaniel Borkmann
1/6
2/6A-b
3/6
4/6
5/6
6/6

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

Read the v1 thread

Cover letter [iproute PATCH 0/6] strlcpy() and strlcat() for iproute2

The following series adds my own implementations of strlcpy() and strlcat() in patch 1 and changes the code to make use of them in the following patches but the last two: Patch 5 just eliminates a line of useless code I found while searching for potential users of the introduced functions, patch 6 sanitizes a call to strncpy() in misc/lnstat_util.c without using strlcpy() since lnstat is not being linked against libutil.

I implemented both functions solely based on information in libbsd's man pages, so they are safe to be released under the GPL.

Phil Sutter (6):
utils: Implement strlcpy() and strlcat() Convert the obvious cases to strlcpy() Convert harmful calls to strncpy() to strlcpy()
ipxfrm: Replace STRBUF_CAT macro with strlcat()
tc_util: No need to terminate an snprintf'ed buffer
lnstat_util: Make sure buffer is NUL-terminated

 genl/ctrl.c           |  2 +-
 include/utils.h       |  3 +++
 ip/ipnetns.c          |  3 +--
 ip/iproute_lwtunnel.c |  3 +--
 ip/ipvrf.c            |  5 ++---
 ip/ipxfrm.c           | 21 +++++----------------
 ip/xfrm_state.c       |  2 +-
 lib/bpf.c             |  3 +--
 lib/fs.c              |  3 +--
 lib/inet_proto.c      |  3 +--
 lib/utils.c           | 19 +++++++++++++++++++
 misc/lnstat_util.c    |  3 ++-
 misc/ss.c             |  3 +--
 tc/em_ipset.c         |  3 +--
 tc/tc_util.c          |  1 -
 15 files changed, 40 insertions(+), 37 deletions(-)
Signature · 1 line
2.13.1