]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Better checks in loops.
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Mon, 24 May 2010 21:45:56 +0000 (23:45 +0200)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Mon, 24 May 2010 21:46:30 +0000 (23:46 +0200)
lib/gnutls_algorithms.c

index ad816082dde2f2f76e7a994277bdb86bf8faf323..4c4c35731adcf6f3b77ff58d5ae76cd33bc38ab9 100644 (file)
@@ -2021,7 +2021,7 @@ _gnutls_x509_oid2sign_algorithm (const char *oid)
 {
   gnutls_sign_algorithm_t ret = 0;
 
-  GNUTLS_SIGN_LOOP (if (strcmp (oid, p->oid) == 0)
+  GNUTLS_SIGN_LOOP (if (p->oid && strcmp (oid, p->oid) == 0)
                    {
                    ret = p->id; break;}
   );
@@ -2241,7 +2241,7 @@ _gnutls_x509_oid2pk_algorithm (const char *oid)
   const gnutls_pk_entry *p;
 
   for (p = pk_algorithms; p->name != NULL; p++)
-    if (strcmp (p->oid, oid) == 0)
+    if (p->oid && strcmp (p->oid, oid) == 0)
       {
        ret = p->id;
        break;