Skip to content

Commit

Permalink
Update imgRead.c
Browse files Browse the repository at this point in the history
  • Loading branch information
hardik05 authored Oct 17, 2024
1 parent dc2d5ba commit 2a428aa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions libAFL/damn_vulnerable_c_program_shmem/imgRead.c
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}
}
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 2a428aa

Please sign in to comment.