]> git.ipfire.org Git - thirdparty/git.git/commit - banned.h
banned.h: mark ctime_r() and asctime_r() as banned
authorJeff King <peff@peff.net>
Tue, 1 Dec 2020 21:11:38 +0000 (13:11 -0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 2 Dec 2020 22:30:39 +0000 (14:30 -0800)
commit91aef030152d121f6b4bc3b933c696073ba073e2
tree576aabc81144240c2a5574c481f7fa77a64d54f3
parent1fbfdf556f2abc708183caca53ae4e2881b46ae2
banned.h: mark ctime_r() and asctime_r() as banned

The ctime_r() and asctime_r() functions are reentrant, but have
no check that the buffer we pass in is long enough (the manpage says it
"should have room for at least 26 bytes"). Since this is such an
easy-to-get-wrong interface, and since we have the much safer strftime()
as well as its more convenient strbuf_addftime() wrapper, let's ban both
of those.

Signed-off-by: Jeff King <peff@peff.net>
Reviewed-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
banned.h