diff options
author | Viktor Dukhovni <openssl-users@dukhovni.org> | 2014-05-11 20:28:56 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2014-05-11 21:09:56 +0100 |
commit | 711bb9bc88f0da7c2a13eb71c1925f3d32fd77ed (patch) | |
tree | 6ad70fc6a63c4cb91953955a23c91970184eb50c | |
parent | f2ebe2a60eacf3e348898175be82971b57d72327 (diff) |
Fix infinite loop. PR#3347
-rw-r--r-- | apps/req.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/apps/req.c b/apps/req.c index 5e034a85e8..d41385d706 100644 --- a/apps/req.c +++ b/apps/req.c @@ -1489,7 +1489,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; @@ -1548,7 +1554,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)) { |