Skip to content

Commit

Permalink
Fix assert() condition in evbuffer_drain() for IOCP
Browse files Browse the repository at this point in the history
In the case of iocp, in the for loop above, there is a situation where:
  remaining == chain->off == 0

And this happens due to CHAIN_PINNED_R() case (that is used only in
buffer_iocp.c)

Closes: libevent#630 (picked)
  • Loading branch information
SuckShit authored and azat committed Apr 22, 2018
1 parent ba78ba9 commit ab3224c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -1146,7 +1146,7 @@ evbuffer_drain(struct evbuffer *buf, size_t len)
}

buf->first = chain;
EVUTIL_ASSERT(remaining < chain->off);
EVUTIL_ASSERT(remaining <= chain->off);
chain->misalign += remaining;
chain->off -= remaining;
}
Expand Down

0 comments on commit ab3224c

Please sign in to comment.