Commit 606c8048 authored by Richard Levitte's avatar Richard Levitte
Browse files

Make sure to NUL-terminate the string on end-of-file (and error)

PR: 643
parent e66d863c
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -494,6 +494,7 @@ static int buffer_gets(BIO *b, char *buf, int size)
			if (i <= 0)
				{
				BIO_copy_next_retry(b);
				*buf='\0';
				if (i < 0) return((num > 0)?num:i);
				if (i == 0) return(num);
				}