From 28a56370d45a674e44f151988a197be9e75c2695 Mon Sep 17 00:00:00 2001 From: Sergey Lyubka Date: Mon, 30 Aug 2021 11:39:19 +0100 Subject: [PATCH] Fix zeromem() call in mg_iobuf_del() --- mongoose.c | 2 +- src/iobuf.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mongoose.c b/mongoose.c index bc26f1dc..ef578edf 100644 --- a/mongoose.c +++ b/mongoose.c @@ -1782,7 +1782,7 @@ size_t mg_iobuf_del(struct mg_iobuf *io, size_t ofs, size_t len) { if (ofs > io->len) ofs = io->len; if (ofs + len > io->len) len = io->len - ofs; memmove(io->buf + ofs, io->buf + ofs + len, io->len - ofs - len); - zeromem(io->buf + ofs + io->len - len, len); + zeromem(io->buf + io->len - len, len); io->len -= len; return len; } diff --git a/src/iobuf.c b/src/iobuf.c index 4856e2bb..900d0af5 100644 --- a/src/iobuf.c +++ b/src/iobuf.c @@ -62,7 +62,7 @@ size_t mg_iobuf_del(struct mg_iobuf *io, size_t ofs, size_t len) { if (ofs > io->len) ofs = io->len; if (ofs + len > io->len) len = io->len - ofs; memmove(io->buf + ofs, io->buf + ofs + len, io->len - ofs - len); - zeromem(io->buf + ofs + io->len - len, len); + zeromem(io->buf + io->len - len, len); io->len -= len; return len; }