banned.h: mark strncat() as banned
authorEric Wong <e@80x24.org>
Wed, 2 Jan 2019 09:38:46 +0000 (09:38 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 2 Jan 2019 18:19:05 +0000 (10:19 -0800)
strncat() has the same quadratic behavior as strcat() and is
difficult-to-read and bug-prone. While it hasn't yet been a
problem in git iself, strncat() found it's way into 'master'
of cgit and caused segfaults on my system.

Signed-off-by: Eric Wong <e@80x24.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
banned.h
index 28f5937035b762ad9fb091ea8fb7cc96f38fc92d..447af24807f49f5df4eace6435acba721745fc2c 100644 (file)
--- a/banned.h
+++ b/banned.h
@@ -16,6 +16,8 @@
 #define strcat(x,y) BANNED(strcat)
 #undef strncpy
 #define strncpy(x,y,n) BANNED(strncpy)
+#undef strncat
+#define strncat(x,y,n) BANNED(strncat)
 
 #undef sprintf
 #undef vsprintf