nghttp: More robust error handling while reading file

This commit is contained in:
Tatsuhiro Tsujikawa 2016-05-14 00:23:44 +09:00
parent e0df95a1d8
commit d00788ceeb
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}