List for cgit developers and users
 help / color / mirror / Atom feed
* [PATCH 1/9] parsing: ban strncpy()
@ 2018-08-28 18:38 list
  2018-08-28 18:38 ` [PATCH 2/9] parsing: ban sprintf() list
                   ` (7 more replies)
  0 siblings, 8 replies; 15+ messages in thread
From: list @ 2018-08-28 18:38 UTC (permalink / raw)


From: Christian Hesse <mail at eworm.de>

Git upstream bans strncpy() with commit:

  banned.h: mark strncpy() as banned
  e488b7aba743d23b830d239dcc33d9ca0745a9ad

Signed-off-by: Christian Hesse <mail at eworm.de>
---
 parsing.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/parsing.c b/parsing.c
index 12453c2..e224564 100644
--- a/parsing.c
+++ b/parsing.c
@@ -63,8 +63,7 @@ static char *substr(const char *head, const char *tail)
 	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;
 }
 


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2018-10-12 21:08 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-28 18:38 [PATCH 1/9] parsing: ban strncpy() list
2018-08-28 18:38 ` [PATCH 2/9] parsing: ban sprintf() list
2018-08-28 18:38 ` [PATCH 3/9] ui-log: ban strcpy() list
2018-08-28 18:38 ` [PATCH 4/9] ui-log: ban strncpy() list
2018-08-28 18:38 ` [PATCH 5/9] ui-patch: ban sprintf() list
2018-08-28 18:38 ` [PATCH 6/9] ui-shared: ban strcat() list
2018-08-28 18:38 ` [PATCH 7/9] ui-ssdiff: ban strncpy() list
2018-08-28 18:38 ` [PATCH 8/9] ui-ssdiff: ban strcat() list
2018-08-28 18:38 ` [PATCH 9/9] RFC: git: update to v2.19.0-rc0 list
2018-08-28 20:13   ` [PATCH 1/1] RFC: git: update to v2.19.0-rc1 list
2018-09-05  6:44     ` [PATCH 1/1] RFC: git: update to v2.19.0-rc2 list
2018-09-10 21:16       ` [PATCH 1/1] git: update to v2.19.0 list
2018-09-11  0:57         ` Jason
2018-09-11  6:48           ` list
2018-10-12 21:08         ` [PATCH 1/1] git: update to v2.19.1 list

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).