[Xastir-dev] Switching string length discussion to here

Tom Russo russo at bogodyn.org
Sun Dec 19 14:33:11 PST 2021


On Sun, Dec 19, 2021 at 03:27:07PM -0700, we recorded a bogon-computron collision of the <russo at bogodyn.org> flavor, containing:
> On Sun, Dec 19, 2021 at 03:25:28PM -0700, we recorded a bogon-computron collision of the <russo at bogodyn.org> flavor, containing:
> > On Sun, Dec 19, 2021 at 03:12:50PM -0600, we recorded a bogon-computron collision of the <godfreja at gmail.com> flavor, containing:
> > > There is also strlcat.
> > 
> > Are these in the C standard, snprintf?
> 
> "unlike snprintf"

It appears that they are not standard in either ISO or POSIX standards.

>From https://stackoverflow.com/questions/2114896/why-are-strlcpy-and-strlcat-considered-insecure

  strlcpy() and strlcat() are not standard, neither ISO C nor POSIX. So, 
  their use in portable programs is impossible. In fact, strlcat() has 
  two different variants: the Solaris implementation is different from 
  the others for edge cases involving length 0. This makes it even less useful 
  than otherwise.

>From the same discussion:

  This API has been adopted by most modern operating systems and many 
  standalone software packages, including OpenBSD (where it originated), 
  Sun Solaris, FreeBSD, NetBSD, the Linux kernel, rsync and the GNOME project. 
  The notable exception is the GNU standard C library, glibc [12], whose 
  maintainer steadfastly refuses to include these improved APIs, labelling
  them "horribly inefficient BSD crap" [4], despite prior evidence that they 
  are faster is most cases than the APIs they replace [13].

  That is why they are not available in glibc, but it is not true that they 
  are not available on Linux. They are available on Linux in libbsd:

    https://libbsd.freedesktop.org/


-- 
Tom Russo    KM5VY
Tijeras, NM  

 echo "prpv_a'rfg_cnf_har_cvcr" | sed -e 's/_/ /g' | tr [a-m][n-z] [n-z][a-m]



More information about the Xastir-dev mailing list