]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Fix crash.
authorSimon Josefsson <simon@josefsson.org>
Mon, 3 Aug 2009 21:37:39 +0000 (23:37 +0200)
committerSimon Josefsson <simon@josefsson.org>
Mon, 3 Aug 2009 21:37:39 +0000 (23:37 +0200)
lib/x509/common.c

index bb265a8675868dea69c365fdc21e46e5d6b8e32c..824a06537b8fc229b3e1e50afffd063585db483c 100644 (file)
@@ -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;
 }