[gnutls-dev] gnutls-0.9.96 build failure on Solaris

Dimitri Papadopoulos-Orfanos papadopo at shfj.cea.fr
Wed Nov 12 14:50:32 CET 2003


Hi,

GnuTLS 0.9.96 fails to build on Solaris 8 using the Sun ONE Studio 7 
compiler.

The problem seems to be that the bundled minitasn1 library doesn't 
include <alloca.h> prior to using alloca():

	#ifdef HAVE_ALLOCA
	# define _asn1_alloca alloca
	# define _asn1_afree(x)
	#else
	# define _asn1_alloca _asn1_malloc
	# define _asn1_afree _asn1_free
	#endif /* HAVE_ALLOCA */

Instead the source code should look like:

	#ifdef HAVE_ALLOCA
	# ifdef HAVE_ALLOCA_H
	#  include <alloca.h>
	# endif
	# define _asn1_alloca alloca
	# define _asn1_afree(x)
	#else
	# define _asn1_alloca _asn1_malloc
	# define _asn1_afree _asn1_free
	#endif /* HAVE_ALLOCA */

By the way, are you sure you really need to use alloca()?
http://sources.redhat.com/ml/gdb/2000-11/threads.html#00053
http://www.gnu.org/software/libc/manual/html_mono/libc.html#Disadvantages%20of%20Alloca
I really don't know much about all that, so bear with me if I'm talking 
complete nonsense, but can't alloca() result in security issues, if 
somehow the software is tricked into allocating more memory than the 
machine can provide?


There were also warnings that could point to real problems, such as 
src/common.h defining:
	void socket_init( void);
instead of
	void sockets_init( void);

Here are some of these warnings:
"gnutls_auth.c", line 98: warning: enum type mismatch: op "="
"gnutls_auth.c", line 122: warning: enum type mismatch: op "="
"auth_cert.c", line 1234: warning: enum type mismatch: arg #2
"serv.c", line 553: warning: implicit function declaration: sockets_init
"serv.c", line 947: warning: statement not reached


Finally there were the usual signed/unsigned warnings you already know 
about. See attached build log.

--
Dimitri
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gnutls-0.9.96.log.gz
Type: application/x-gzip
Size: 14505 bytes
Desc: not available
URL: </pipermail/attachments/20031112/b8e7d0e3/attachment.bin>


More information about the Gnutls-devel mailing list