From: Viktor Dukhovni Date: Sun, 11 May 2014 19:28:56 +0000 (+0100) Subject: Fix infinite loop. PR#3347 X-Git-Tag: OpenSSL_1_0_1h~51 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=c3c6fc7855816d8a9866a2033dd6bf7ed6a3a9af;p=oweals%2Fopenssl.git Fix infinite loop. PR#3347 --- 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)) {