projects
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Buffer size handling fix for enc.
[openssl.git]
/
apps
/
enc.c
diff --git
a/apps/enc.c
b/apps/enc.c
index ea948f8d101b3d958861584c5bb65106fe779b58..3e3e8eb4b8a74c4ab62aed3c8d94a946b61ab029 100644
(file)
--- a/
apps/enc.c
+++ b/
apps/enc.c
@@
-340,7
+340,7
@@
bad:
}
/* It must be large enough for a base64 encoded line */
}
/* It must be large enough for a base64 encoded line */
- if (n < 80) n=80;
+ if (
base64 &&
n < 80) n=80;
bsize=(int)n;
if (verbose) BIO_printf(bio_err,"bufsize=%d\n",bsize);
bsize=(int)n;
if (verbose) BIO_printf(bio_err,"bufsize=%d\n",bsize);
@@
-370,7
+370,11
@@
bad:
}
if (inf == NULL)
}
if (inf == NULL)
+ {
+ if (bufsize != NULL)
+ setvbuf(stdin, (char *)NULL, _IONBF, 0);
BIO_set_fp(in,stdin,BIO_NOCLOSE);
BIO_set_fp(in,stdin,BIO_NOCLOSE);
+ }
else
{
if (BIO_read_filename(in,inf) <= 0)
else
{
if (BIO_read_filename(in,inf) <= 0)
@@
-421,6
+425,8
@@
bad:
if (outf == NULL)
{
BIO_set_fp(out,stdout,BIO_NOCLOSE);
if (outf == NULL)
{
BIO_set_fp(out,stdout,BIO_NOCLOSE);
+ if (bufsize != NULL)
+ setvbuf(stdout, (char *)NULL, _IONBF, 0);
#ifdef OPENSSL_SYS_VMS
{
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
#ifdef OPENSSL_SYS_VMS
{
BIO *tmpbio = BIO_new(BIO_f_linebuffer());