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 <e@80x24.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Eric Wong 2019-01-02 09:38:46 +00:00 коммит произвёл Junio C Hamano
Родитель 0d0ac3826a
Коммит ace5707a80
1 изменённых файлов: 2 добавлений и 0 удалений

Просмотреть файл

@ -16,6 +16,8 @@
#define strcat(x,y) BANNED(strcat) #define strcat(x,y) BANNED(strcat)
#undef strncpy #undef strncpy
#define strncpy(x,y,n) BANNED(strncpy) #define strncpy(x,y,n) BANNED(strncpy)
#undef strncat
#define strncat(x,y,n) BANNED(strncat)
#undef sprintf #undef sprintf
#undef vsprintf #undef vsprintf