Skip to content

Commit ace5707

Browse files
Eric Wonggitster
authored andcommitted
banned.h: mark strncat() as banned
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 0d0ac38 commit ace5707

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

banned.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
#define strcat(x,y) BANNED(strcat)
1717
#undef strncpy
1818
#define strncpy(x,y,n) BANNED(strncpy)
19+
#undef strncat
20+
#define strncat(x,y,n) BANNED(strncat)
1921

2022
#undef sprintf
2123
#undef vsprintf

0 commit comments

Comments
 (0)