From d3c139e195191803579faa1ba5d5183e6290437f Mon Sep 17 00:00:00 2001 From: Patrick Pelissier Date: Mon, 14 Aug 2017 23:33:08 +0200 Subject: [PATCH] Add assertion --- m-string.h | 1 + 1 file changed, 1 insertion(+) diff --git a/m-string.h b/m-string.h index ad99f25a..ded0a4ef 100644 --- a/m-string.h +++ b/m-string.h @@ -247,6 +247,7 @@ string_set_n(string_t v, const string_t ref, size_t offset, size_t length) { STRING_CONTRACT (v); STRING_CONTRACT (ref); + assert (offset <= ref->size); assert (v != ref); // Not supported yet if (M_UNLIKELY (ref->size == 0)) { v->size = 0;