X-Git-Url: https://git.distorted.org.uk/~mdw/secnet/blobdiff_plain/7b1a9fb74228564b5ee07b48c042ee7b9a2260f1..b7164ab60bf28a93fc02bb65b784134fcbbc41c5:/util.c diff --git a/util.c b/util.c index 63fe76f..086c234 100644 --- a/util.c +++ b/util.c @@ -269,6 +269,7 @@ void *buf_unappend(struct buffer_if *buf, int32_t amount) { void *buf_unprepend(struct buffer_if *buf, int32_t amount) { void *p; + if (buf->size < amount) return 0; p=buf->start; buf->start+=amount; buf->size-=amount;