From: Simon Josefsson Date: Mon, 3 Aug 2009 21:37:39 +0000 (+0200) Subject: Fix crash. X-Git-Tag: gnutls_2_9_2~42 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9b0dc81885ea61fcb57a2be0340cd4859be159b2;p=thirdparty%2Fgnutls.git Fix crash. --- diff --git a/lib/x509/common.c b/lib/x509/common.c index bb265a8675..824a06537b 100644 --- a/lib/x509/common.c +++ b/lib/x509/common.c @@ -309,12 +309,13 @@ _gnutls_x509_oid_data2string (const char *oid, void *value, } } } - - /* Convert null char in the name to '?' - * to protect applications */ - for (i=0;i<*res_size;i++) { - if (res[i] == 0) res[i]='?'; - } + + if (res) + /* Convert null char in the name to '?' + * to protect applications */ + for (i = 0; i < *res_size; i++) { + if (res[i] == 0) + res[i] = '?'; return 0; }