From 59c97cfee4cf2873bccf646eb5906b24627b01f6 Mon Sep 17 00:00:00 2001 From: James Cowgill Date: Fri, 5 May 2017 10:33:56 +0100 Subject: [PATCH] memory: Fix buffer overflow when position == NUM_BUFFERS --- driver/others/memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/driver/others/memory.c b/driver/others/memory.c index 6c62c686e..8564b285b 100644 --- a/driver/others/memory.c +++ b/driver/others/memory.c @@ -1015,7 +1015,7 @@ void *blas_memory_alloc(int procpos){ mypos = WhereAmI(); position = mypos; - while (position > NUM_BUFFERS) position >>= 1; + while (position >= NUM_BUFFERS) position >>= 1; do { if (!memory[position].used && (memory[position].pos == mypos)) {