summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2018-02-28 13:44:01 +0000
committerCarsten Leonhardt <leo@debian.org>2019-07-11 00:13:59 +0200
commit2e71b691afdb270a5555487baae0b5998663399f (patch)
tree0cff3710a965516a1d44d6a7a7418a8c5fd2c609
parentb1c145fac0dfd1e336db202a9978f18345678b91 (diff)
Bugfix
Origin: https://github.com/graygnuorg/pound/commit/c5a95780e2233a05ab3fb8b4eb8a9550f0c3b53c * http.c: Stop if BIO_read returns <= 0 Gbp-Pq: Name 0005-bugfix-BIO_read
-rw-r--r--http.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/http.c b/http.c
index 94fc902..5a0f131 100644
--- a/http.c
+++ b/http.c
@@ -143,7 +143,7 @@ get_line(BIO *const in, char *const buf, const int bufsize)
if(tmp != '\n') {
/* we have CR not followed by NL */
do {
- if(BIO_read(in, &tmp, 1) < 0)
+ if(BIO_read(in, &tmp, 1) <= 0)
return 1;
} while(tmp != '\n');
return 1;
@@ -170,7 +170,7 @@ get_line(BIO *const in, char *const buf, const int bufsize)
/* all other control characters cause an error */
do {
- if(BIO_read(in, &tmp, 1) < 0)
+ if(BIO_read(in, &tmp, 1) <= 0)
return 1;
} while(tmp != '\n');
return 1;
@@ -178,7 +178,7 @@ get_line(BIO *const in, char *const buf, const int bufsize)
/* line too long */
do {
- if(BIO_read(in, &tmp, 1) < 0)
+ if(BIO_read(in, &tmp, 1) <= 0)
return 1;
} while(tmp != '\n');
return 1;