summaryrefslogtreecommitdiff
path: root/crypto/conf
diff options
context:
space:
mode:
authorlevitte <levitte>2002-11-14 06:51:06 +0000
committerlevitte <levitte>2002-11-14 06:51:06 +0000
commit8892af23d314bb9622bc779e4b3e6eeaf59e8ee8 (patch)
treee8df5c4376d6e56850c0d25dfb4d220a131d06ff /crypto/conf
parentcffa22e718c34aba21ee337de03c1d9901230ba7 (diff)
downloadopenssl-8892af23d314bb9622bc779e4b3e6eeaf59e8ee8.tar.gz
Handle last lines that aren't properly terminated.
PR: 308
Diffstat (limited to 'crypto/conf')
-rw-r--r--crypto/conf/conf_def.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/crypto/conf/conf_def.c b/crypto/conf/conf_def.c
index 806677dc1..57d2739ae 100644
--- a/crypto/conf/conf_def.c
+++ b/crypto/conf/conf_def.c
@@ -253,9 +253,9 @@ static int def_load_bio(CONF *conf, BIO *in, long *line)
section_sk=(STACK_OF(CONF_VALUE) *)sv->value;
bufnum=0;
+ again=0;
for (;;)
{
- again=0;
if (!BUF_MEM_grow(buff,bufnum+CONFBUFSIZE))
{
CONFerr(CONF_F_CONF_LOAD_BIO,ERR_R_BUF_LIB);
@@ -266,7 +266,8 @@ static int def_load_bio(CONF *conf, BIO *in, long *line)
BIO_gets(in, p, CONFBUFSIZE-1);
p[CONFBUFSIZE-1]='\0';
ii=i=strlen(p);
- if (i == 0) break;
+ if (i == 0 && !again) break;
+ again=0;
while (i > 0)
{
if ((p[i-1] != '\r') && (p[i-1] != '\n'))
@@ -276,7 +277,7 @@ static int def_load_bio(CONF *conf, BIO *in, long *line)
}
/* we removed some trailing stuff so there is a new
* line on the end. */
- if (i == ii)
+ if (ii && i == ii)
again=1; /* long line */
else
{