This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]