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