From: Sebastian Harl Date: Wed, 23 Apr 2014 21:39:58 +0000 (+0200) Subject: utils strbuf: Don't copy more than needed in sdb_strbuf_skip(). X-Git-Tag: sysdb-0.1.0~88 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=fcb70978d61d92c8e8b74d9a41205bd4aef718d0;p=sysdb.git utils strbuf: Don't copy more than needed in sdb_strbuf_skip(). --- 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 */