From c7ada53d4e610dd601bbc7025164a386ec2ffe02 Mon Sep 17 00:00:00 2001 From: Fabian Druschke Date: Tue, 26 Mar 2024 13:28:10 -0300 Subject: [PATCH] Fixed memory leak in line 328, writing 1 byte beyond allocated memory. --- src/pass.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pass.c b/src/pass.c index 9c730da..fc48ac1 100644 --- a/src/pass.c +++ b/src/pass.c @@ -324,7 +324,7 @@ int nwipe_random_pass( NWIPE_METHOD_SIGNATURE ) /* For the first block only, check the prng actually wrote something to the buffer */ if( z == c->device_size ) { - idx = c->device_stat.st_blksize; + idx = c->device_stat.st_blksize - 1; while( idx > 0 ) { if( b[idx] != 0 )