From 2a428aa700db9b69112f08c2e87b4808e77caec2 Mon Sep 17 00:00:00 2001 From: Hardik Shah Date: Thu, 17 Oct 2024 08:47:42 +0530 Subject: [PATCH] Update imgRead.c --- libAFL/damn_vulnerable_c_program_shmem/imgRead.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libAFL/damn_vulnerable_c_program_shmem/imgRead.c b/libAFL/damn_vulnerable_c_program_shmem/imgRead.c index 4a378ac..8b09fac 100644 --- a/libAFL/damn_vulnerable_c_program_shmem/imgRead.c +++ b/libAFL/damn_vulnerable_c_program_shmem/imgRead.c @@ -52,12 +52,12 @@ int ProcessImage(char* filename){ memcpy(buff1,img->data,sizeof(img->data)); free(buff1); //double free - if (size1/3==0){ + if (size1%3==0){ free(buff1); } else{ //use after free - if(size1/20 == 0){ + if(size1%2 == 0){ buff1[0]='a'; } } @@ -87,7 +87,7 @@ int ProcessImage(char* filename){ buff3[size3]='c'; buff4[size1]='c'; - if(size3/5==0){ + if(size3%5==0){ //memory leak here buff4=0; }