Vulnerability Development mailing list archives

argc issue


From: padre () correo ugr es
Date: Tue, 23 May 2006 19:51:58 +0200 (MEST)

hi!

i' ve a code thats looks like:

------------------- code ----------------------
int main (int argc, char **argv)
{
char *a;
char *b;

a=malloc(char *)(100);
b=malloc(char *)(100);

 if (argc)
    exit (-1);
 else {
      strcpy(a,argv[1]);
      }

free (a);

return 0;
}

---------------- code ---------------------------

I contais an explotable heap overflow. I can overwrite b's chunk head so I
can write into DTOR_END the addr i want.

But the main issue is " if (argc) exit(0);" . How can I change the argc
variable so it contais the value of 0?.

thanks and srry for my poor english :(


Current thread: