From 9ec250ef19d96b682a67b800d302bf68620aa47f Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Mon, 7 Oct 2002 16:36:26 +0000 Subject: *** empty log message *** --- lib/gnutls_x509.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/gnutls_x509.c b/lib/gnutls_x509.c index 079effda3b..14e1091226 100644 --- a/lib/gnutls_x509.c +++ b/lib/gnutls_x509.c @@ -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; } -- cgit v1.2.1