Browse Source

Avoid out of bounds access on invalid memory free

tags/v0.3.11^2
Alexander Grund 5 years ago
parent
commit
3c05f54df8
No known key found for this signature in database GPG Key ID: E92C451FC21EF13F
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      driver/others/memory.c

+ 2
- 1
driver/others/memory.c View File

@@ -2882,9 +2882,10 @@ void blas_memory_free(void *free_area){
while ((position < NUM_BUFFERS) && (memory[position].addr != free_area)) while ((position < NUM_BUFFERS) && (memory[position].addr != free_area))
position++; position++;


if (memory[position].addr != free_area) goto error;
if (position >= NUM_BUFFERS) goto error;


#ifdef DEBUG #ifdef DEBUG
if (memory[position].addr != free_area) goto error;
printf(" Position : %d\n", position); printf(" Position : %d\n", position);
#endif #endif




Loading…
Cancel
Save