Add big comment why we need strlcat everywhere. - geomyidae - A small C-based gopherd.
(HTM) git clone git://bitreich.org/geomyidae/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/geomyidae/
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) Tags
(DIR) README
(DIR) LICENSE
---
(DIR) commit 60b382884e98afcc7e8dc4b679094ef2a1c652fa
(DIR) parent 96c7692574c9f7edf5faf5c98cafb8473b0fc1ce
(HTM) Author: Christoph Lohmann <20h@r-36.net>
Date: Thu, 10 Aug 2023 11:51:56 +0200
Add big comment why we need strlcat everywhere.
Diffstat:
M main.c | 11 +++++++++++
1 file changed, 11 insertions(+), 0 deletions(-)
---
(DIR) diff --git a/main.c b/main.c
@@ -356,6 +356,17 @@ dothegopher:
}
return;
}
+ /*
+ * The size check for strcat to work is
+ * above.
+ *
+ * Until strlcat isn't properly in all
+ * linux libcs, we keep to this. OpenBSD
+ * will complain about strcat and
+ * smart-ass gcc will cmplain about
+ * strncat of one char static char array
+ * is an overflow.
+ */
if (rpath[len-1] != '/')
strcat(rpath, "/");
strcat(rpath, indexf[i]);