From fcb70978d61d92c8e8b74d9a41205bd4aef718d0 Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Wed, 23 Apr 2014 23:39:58 +0200 Subject: [PATCH] utils strbuf: Don't copy more than needed in sdb_strbuf_skip(). --- src/utils/strbuf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/strbuf.c b/src/utils/strbuf.c index ee419b7..822f019 100644 --- a/src/utils/strbuf.c +++ b/src/utils/strbuf.c @@ -306,7 +306,7 @@ sdb_strbuf_skip(sdb_strbuf_t *strbuf, size_t offset, size_t n) assert(offset < strbuf->pos); start = strbuf->string + offset; - memmove(start, start + n, strbuf->pos - n); + memmove(start, start + n, len - n); strbuf->pos -= n; strbuf->string[strbuf->pos] = '\0'; } /* sdb_strbuf_skip */ -- 2.30.2