Commit cc7929bd authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

Fix possible SIGFPE

parent a82b7f09
...@@ -146,6 +146,10 @@ int32_t nghttp2_stream_dep_distributed_weight(nghttp2_stream *stream, ...@@ -146,6 +146,10 @@ int32_t nghttp2_stream_dep_distributed_weight(nghttp2_stream *stream,
int32_t nghttp2_stream_dep_distributed_effective_weight int32_t nghttp2_stream_dep_distributed_effective_weight
(nghttp2_stream *stream, int32_t weight) (nghttp2_stream *stream, int32_t weight)
{ {
if(stream->sum_norest_weight == 0) {
return stream->effective_weight;
}
weight = stream->effective_weight * weight / stream->sum_norest_weight; weight = stream->effective_weight * weight / stream->sum_norest_weight;
return nghttp2_max(1, weight); return nghttp2_max(1, weight);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment