From d00788ceeb3d75b692815aa908c68bae86aaa97a Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sat, 14 May 2016 00:23:44 +0900 Subject: [PATCH] nghttp: More robust error handling while reading file --- src/nghttp.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nghttp.cc b/src/nghttp.cc index f1e4feca..2c427947 100644 --- a/src/nghttp.cc +++ b/src/nghttp.cc @@ -2355,7 +2355,7 @@ ssize_t file_read_callback(nghttp2_session *session, int32_t stream_id, return nread; } - if (nread == 0) { + if (req->data_offset > req->data_length || nread == 0) { return NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE; }