This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Building libssp on a system without gets()
- From: Gerald Pfeifer <gerald at pfeifer dot com>
- To: Jakub Jelinek <jakub at redhat dot com>, gcc at gcc dot gnu dot org
- Cc: Ed Maste <emaste at freebsd dot org>
- Date: Sun, 5 Aug 2018 17:58:31 +0200 (CEST)
- Subject: Building libssp on a system without gets()
Hi Jakub,
some folks in FreeBSD-land have worked to remove all uses of gets()
and in fact the gets() function itself.
Generally GCC builds just fine in such an environment, except for
libssp where libssp/gets-chk.c has the following:
char *
__gets_chk (char *s, size_t slen)
{
char *ret, *buf;
if (slen >= (size_t) INT_MAX)
==> return gets (s); <==
if (slen <= 8192)
buf = alloca (slen + 1);
else
buf = malloc (slen + 1);
if (buf == NULL)
==> return gets (s); <==
Here gets() is used in two edge/error cases only.
What do you think of abort()ing on systems where gets() is not
available, via a bit of autoconf magic? Is this something you
may be able to help with?
Gerald
PS: https://reviews.freebsd.org/D12298 has some background re FreeBSD.