This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Building libssp on a system without gets()
- From: Gerald Pfeifer <gerald at pfeifer dot com>
- To: Florian Weimer <fw at deneb dot enyo dot de>, Jakub Jelinek <jakub at redhat dot com>
- Cc: gcc at gcc dot gnu dot org, Ed Maste <emaste at freebsd dot org>
- Date: Sun, 9 Jun 2019 16:24:31 +0200 (CEST)
- Subject: Re: Building libssp on a system without gets()
- References: <alpine.LSU.2.21.1808051730170.3834@anthias.pfeifer.com> <87pnywprqh.fsf@mid.deneb.enyo.de>
On Sun, 5 Aug 2018, Florian Weimer wrote:
>> 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?
> If the system doesn't have gets, you will not need __gets_chk, either.
Thanks, Florian, makes sense.
Jakub, any chance you can have a look? (I had, and my configure
foo isn't strong enough.)
Gerald