summaryrefslogtreecommitdiffstats
path: root/apps
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 21:20:00 +0100
commitafa2ea204ef6f2a818886aa0506c938bb343547e (patch)
tree40385d925564f619b9b7a4bc5993fd5c36977b81 /apps
parent0b6394c73806c340d49bed69956d37dc14c8a3b7 (diff)
Fix infinite loop. PR#3347
Diffstat (limited to 'apps')
-rw-r--r--apps/req.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/apps/req.c b/apps/req.c
index 9f55cdeabd..afabd6ca78 100644
--- a/apps/req.c
+++ b/apps/req.c
@@ -1574,7 +1574,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;
@@ -1633,7 +1639,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)) {