From: Nikos Mavrogiannopoulos Date: Sat, 24 Jul 2010 14:25:28 +0000 (+0200) Subject: Do not trust fbase64_decode to return 0 on success. X-Git-Tag: gnutls_2_11_3~80 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f206e15d78ea64d60ae1716a75c7f7ad8a87a1c9;p=thirdparty%2Fgnutls.git Do not trust fbase64_decode to return 0 on success. --- diff --git a/lib/x509/privkey.c b/lib/x509/privkey.c index 834a8a7dd9..7929f94d1b 100644 --- a/lib/x509/privkey.c +++ b/lib/x509/privkey.c @@ -376,7 +376,7 @@ gnutls_x509_privkey_import (gnutls_x509_privkey_t key, result = _gnutls_fbase64_decode (PEM_KEY_RSA, data->data, data->size, &out); - if (result == 0) key->pk_algorithm = GNUTLS_PK_RSA; + if (result >= 0) key->pk_algorithm = GNUTLS_PK_RSA; if (result == GNUTLS_E_BASE64_UNEXPECTED_HEADER_ERROR) {