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:15:57 +0100 |
commit | f9f6befa1fe7da4ad4f43a7873f6e586e03c7568 (patch) | |
tree | e815de5e34fd184d3d2f2c09958787a7817ff807 | |
parent | 0552cbcdaaa367f911ffa62af0eda4ac54a3eee4 (diff) | |
download | openssl-f9f6befa1fe7da4ad4f43a7873f6e586e03c7568.zip openssl-f9f6befa1fe7da4ad4f43a7873f6e586e03c7568.tar.gz openssl-f9f6befa1fe7da4ad4f43a7873f6e586e03c7568.tar.bz2 |
Fix infinite loop. PR#3347
-rw-r--r-- | apps/req.c | 15 |
1 files changed, 13 insertions, 2 deletions
@@ -1476,7 +1476,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; @@ -1535,7 +1541,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)) { |