summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2002-10-07 16:36:26 +0000
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2002-10-07 16:36:26 +0000
commit9ec250ef19d96b682a67b800d302bf68620aa47f (patch)
tree04153e89c0462147ea8ecdec96ebae1a15179d13
parent97546bf79b8283303ef6f8acee167dea89d00d69 (diff)
downloadgnutls-9ec250ef19d96b682a67b800d302bf68620aa47f.tar.gz
*** empty log message ***
-rw-r--r--lib/gnutls_x509.c11
1 files 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;
}