Introduce strlcat() instead of strcat(), and replace all sizeof() of buffers inside structures with constants where possible, to avoid bugs caused by reading the size of a pointer instead of the size of the buffer it points to.

This commit is contained in:
Andrew Wood
2023-07-23 01:57:00 +01:00
parent 80e3f791c4
commit c7e0bb727e
12 changed files with 171 additions and 80 deletions
+1 -1
View File
@@ -39,7 +39,7 @@ AC_SYS_LARGEFILE
AC_HEADER_TIOCGWINSZ
AC_CHECK_FUNCS(getopt_long getopt)
AC_CHECK_HEADERS(getopt.h)
AC_CHECK_FUNCS(memcpy basename vsnprintf)
AC_CHECK_FUNCS(memcpy basename vsnprintf strlcat)
AC_CHECK_HEADERS(limits.h)
AC_ARG_ENABLE(debugging,
+3
View File
@@ -81,6 +81,9 @@
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the `strlcat' function. */
#undef HAVE_STRLCAT
/* Define to 1 if you have the <sys/ipc.h> header file. */
#undef HAVE_SYS_IPC_H