diff options
author | Azat Khuzhin <azat@libevent.org> | 2019-05-11 00:17:03 +0300 |
---|---|---|
committer | Azat Khuzhin <azat@libevent.org> | 2019-05-16 10:16:21 +0300 |
commit | 401bd1c09e9753ce997539c177cb1e48025a7343 (patch) | |
tree | c89eff40efe4033a0c076d3920526be44302a633 /buffer.c | |
parent | 244cacaf8ccfe8b8978df20791998bbc92225dc8 (diff) | |
download | libevent-401bd1c09e9753ce997539c177cb1e48025a7343.tar.gz |
evbuffer: fix last_with_datap after prepend with empty chain
last_with_datap should be adjusted only if it buf->first *was* not
empty, otherwise last_with_datap should point to the prepended chain.
Diffstat (limited to 'buffer.c')
-rw-r--r-- | buffer.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1905,7 +1905,7 @@ evbuffer_prepend(struct evbuffer *buf, const void *data, size_t datlen) if ((tmp = evbuffer_chain_new(datlen)) == NULL) goto done; buf->first = tmp; - if (buf->last_with_datap == &buf->first) + if (buf->last_with_datap == &buf->first && chain->off) buf->last_with_datap = &tmp->next; tmp->next = chain; |