all repos — cgit @ 7cde5885d8ce53359ee665bb930b1da956e8369a

a hyperfast web frontend for git written in c

parsing: ban strncpy()

Git upstream bans strncpy() with commit:

  banned.h: mark strncpy() as banned
  e488b7aba743d23b830d239dcc33d9ca0745a9ad

Signed-off-by: Christian Hesse <mail@eworm.de>
Christian Hesse mail@eworm.de
Tue, 28 Aug 2018 18:11:50 +0200
commit

7cde5885d8ce53359ee665bb930b1da956e8369a

parent

b0fc647fe61c19338aec65ffcab513cc84599b18

1 files changed, 1 insertions(+), 2 deletions(-)

jump to
M parsing.cparsing.c

@@ -63,8 +63,7 @@

if (tail < head) return xstrdup(""); buf = xmalloc(tail - head + 1); - strncpy(buf, head, tail - head); - buf[tail - head] = '\0'; + strlcpy(buf, head, tail - head + 1); return buf; }