Skip to content

Commit

Permalink
Update dvcp.c
Browse files Browse the repository at this point in the history
changed / to % to check remainder.
  • Loading branch information
hardik05 authored Sep 26, 2024
1 parent 5598f1d commit d6b7a61
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions dvcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ int ProcessImage(char* filename){
memcpy(buff1,img.data,sizeof(img.data));
free(buff1);
//double free
if (size1/2==0){
if (size1 % 2 == 0){
free(buff1);
}
else{
//use after free
if(size1/3 == 0){
if(size1 % 3 == 0){
buff1[0]='a';
}
}
Expand Down Expand Up @@ -102,7 +102,7 @@ int ProcessImage(char* filename){
free(buff4);
}
int size4 = img.width * img.height;
if(size4/2==0){
if(size4 % 2 == 0){
//stack exhaustion here
stack_operation();
}
Expand Down

0 comments on commit d6b7a61

Please sign in to comment.