diff options
author | Richard Levitte <levitte@openssl.org> | 2002-11-14 06:49:45 +0000 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2002-11-14 06:49:45 +0000 |
commit | 8df1de4e89acfe9d2f5893ae6be7611a3f5b544c (patch) | |
tree | 55d2021dda7b7829406a90b73e2e1e210fbad914 /crypto/conf | |
parent | ff749aea447be08c0adddc9f1c280a34afd597ae (diff) |
Handle last lines that aren't properly terminated.
PR: 308
Diffstat (limited to 'crypto/conf')
-rw-r--r-- | crypto/conf/conf_def.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/crypto/conf/conf_def.c b/crypto/conf/conf_def.c index d43c9de3f5..adc28eebff 100644 --- a/crypto/conf/conf_def.c +++ b/crypto/conf/conf_def.c @@ -224,9 +224,9 @@ static int def_load(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+BUFSIZE)) { CONFerr(CONF_F_CONF_LOAD_BIO,ERR_R_BUF_LIB); @@ -237,7 +237,8 @@ static int def_load(CONF *conf, BIO *in, long *line) BIO_gets(in, p, BUFSIZE-1); p[BUFSIZE-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')) @@ -247,7 +248,7 @@ static int def_load(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 { |