[gnutls-dev] GnuTLS 2.0.0

Simon Josefsson simon at josefsson.org
Tue Sep 11 08:47:35 CEST 2007


ludovic.courtes at laas.fr (Ludovic Courtès) writes:

> No, it's an actual bug, observed on PowerPC (and the RPATH problem
> _was_ solved AFAICS).

Ok, I applied the patch.

> Is `gnutls_x509_crt_get_dn_oid ()' supposed to return a
> null-terminated string?  The documentation doesn't mention it and it
> seems that it's not returning a null-terminated string.

I'm not sure, _gnutls_x509_get_dn_oid contains this code:

	      len = strlen (oid) + 1;

	      if (*sizeof_oid < (unsigned) len)
		{
		  *sizeof_oid = len;
		  gnutls_assert ();
		  return GNUTLS_E_SHORT_MEMORY_BUFFER;
		}

	      memcpy (_oid, oid, len);
	      *sizeof_oid = len - 1;

Which indicate that the intention is to copy the terminating zero.
However, it may be that the call to asn1_read_value did not add a zero.
That may be a bug, typically asn1_read_value do zero-terminate strings
if I recall correctly (although it isn't well documented either).

> In any case, using `scm_take_locale_stringn ()' instead of just
> `scm_take_locale_string ()' can't hurt.

Right.

/Simon




More information about the Gnutls-devel mailing list