]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
*** empty log message ***
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Mon, 7 Oct 2002 16:36:26 +0000 (16:36 +0000)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Mon, 7 Oct 2002 16:36:26 +0000 (16:36 +0000)
lib/gnutls_x509.c

index 079effda3bf65cf2645f9aa57b218a2ce91a67db..14e1091226b4b31be3002541e43d00e8bd037447 100644 (file)
@@ -2849,10 +2849,13 @@ int gnutls_x509_extract_certificate_dn_string(char *buf, int sizeof_buf,
 
    buf[0] = 0;
 
-#define PRINTX(buf, bufsize, x, y) \
-   if (y[0]!=0 && (strlen(x)+strlen(y)+4 < bufsize)) \
+#define PRINTX(buf, bufsize, x, y) \
+   if (y[0]!=0 && (strlen(x)+strlen(y)+4 < bufsize)) \
       sprintf(buf, "/%s=%s", x, y); \
-}
+   } else { \
+      return GNUTLS_E_INVALID_REQUEST; \
+   }
+
    if (!issuer)
       gnutls_x509_extract_certificate_dn(cert, &dn);
    else
@@ -2872,5 +2875,5 @@ int gnutls_x509_extract_certificate_dn_string(char *buf, int sizeof_buf,
    len = strlen(buf);
    PRINTX(buf + len, sizeof_buf - len - 1, "E", dn.email);
 
-   return;
+   return 0;
 }