summaryrefslogtreecommitdiffstats
path: root/apps/req.c
diff options
context:
space:
mode:
authorViktor Dukhovni <openssl-users@dukhovni.org>2014-05-11 20:28:56 +0100
committerMatt Caswell <matt@openssl.org>2014-05-11 20:28:56 +0100
commitb00676bb6f75ecc10d838a844cc9b54c36a4ba0b (patch)
treee859fa9e8d741a457299844e12231c98a90eb632 /apps/req.c
parent971a7c5ff751d95bf33117e95a6acf2cfc951537 (diff)
Fix infinite loop. PR#3347
Diffstat (limited to 'apps/req.c')
-rw-r--r--apps/req.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/apps/req.c b/apps/req.c
index 316163ff78..6a19144931 100644
--- a/apps/req.c
+++ b/apps/req.c
@@ -1486,7 +1486,13 @@ start:
#ifdef CHARSET_EBCDIC
ebcdic2ascii(buf, buf, i);
#endif
- if(!req_check_len(i, n_min, n_max)) goto start;
+ if(!req_check_len(i, n_min, n_max))
+ {
+ if (batch || value)
+ return 0;
+ goto start;
+ }
+
if (!X509_NAME_add_entry_by_NID(n,nid, chtype,
(unsigned char *) buf, -1,-1,mval)) goto err;
ret=1;
@@ -1545,7 +1551,12 @@ start:
#ifdef CHARSET_EBCDIC
ebcdic2ascii(buf, buf, i);
#endif
- if(!req_check_len(i, n_min, n_max)) goto start;
+ if(!req_check_len(i, n_min, n_max))
+ {
+ if (batch || value)
+ return 0;
+ goto start;
+ }
if(!X509_REQ_add1_attr_by_NID(req, nid, chtype,
(unsigned char *)buf, -1)) {