From 1d7e93251c70fd87923e021fe8ab8a36d0845572 Mon Sep 17 00:00:00 2001 From: Patrick Pelissier Date: Thu, 11 Nov 2021 19:39:12 +0100 Subject: [PATCH] Fix overflow of one element in deque _remove --- m-deque.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/m-deque.h b/m-deque.h index 701dd64b..f4c2ee9b 100644 --- a/m-deque.h +++ b/m-deque.h @@ -720,7 +720,7 @@ M_CALL_FREE(oplist, n); \ } else { \ memmove(&n->data[it->index], &n->data[it->index+1], \ - sizeof(type) * (it->node->size - it->index)); \ + sizeof(type) * (it->node->size - it->index - 1)); \ /* We lose capacity of the node... */ \ n->size --; \ /* The iterator points to the next element \