summaryrefslogtreecommitdiff
path: root/banned.h
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2018-07-24 09:26:39 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-07-26 17:12:50 (GMT)
commit1b11b64b815db62f93a04242e4aed5687a448748 (patch)
treed2586029cf8eca4bbef35af2331b36e19d2ff48a /banned.h
parentc8af66ab8ad7cd78557f0f9f5ef6a52fd46ee6dd (diff)
downloadgit-1b11b64b815db62f93a04242e4aed5687a448748.zip
git-1b11b64b815db62f93a04242e4aed5687a448748.tar.gz
git-1b11b64b815db62f93a04242e4aed5687a448748.tar.bz2
banned.h: mark strcat() as banned
The strcat() function has all of the same overflow problems as strcpy(). And as a bonus, it's easy to end up accidentally quadratic, as each subsequent call has to walk through the existing string. The last strcat() call went away in f063d38b80 (daemon: use cld->env_array when re-spawning, 2015-09-24). In general, strcat() can be replaced either with a dynamic string (strbuf or xstrfmt), or with xsnprintf if you know the length is bounded. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'banned.h')
-rw-r--r--banned.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/banned.h b/banned.h
index 1a3e526..34f22a4 100644
--- a/banned.h
+++ b/banned.h
@@ -12,5 +12,7 @@
#undef strcpy
#define strcpy(x,y) BANNED(strcpy)
+#undef strcat
+#define strcat(x,y) BANNED(strcat)
#endif /* BANNED_H */