summaryrefslogtreecommitdiff
path: root/pkt.h
diff options
context:
space:
mode:
Diffstat (limited to 'pkt.h')
-rw-r--r--pkt.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/pkt.h b/pkt.h
index 5b8640c..cd08a50 100644
--- a/pkt.h
+++ b/pkt.h
@@ -72,7 +72,7 @@ static inline uint8_t *pkt_put(struct pkt *p, size_t len)
assert(pkt_invariant(p));
- if (len <= pkt_len(p)) {
+ if (pkt_len(p) + len <= p->size) {
data = p->tail;
p->tail += len;
} else {