matoit1 / skipfish

Automatically exported from code.google.com/p/skipfish
Apache License 2.0
0 stars 0 forks source link

Three Memory malloc bug in http_client.c:parser_url() @ ver 1.49beta #80

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
1) memory leak at http_client.c:270
   fix:
     ck_free(host);
     return 1;
---------------------------------------------------------------------------
2) memory leak and fallacious free at http_client.c:287-288
   fix:
     ck_free(host);
     free(output);    // here we should use default free function instead of ck_free(); for idna_to_ascii_8z() malloc output with default malloc();
     return 1;
---------------------------------------------------------------------------
3) fallacious memory calloc and free at http_client.c:291-292
   fix:
      ck_free(host);
      host = ck_memdup((u8*)output,strlen(output) + 1); // recalloc host with ck_calloc.
      host[strlen(output)] = 0;
      free(output); // the same reason with previous bug

Original issue reported on code.google.com by bsn0w...@gmail.com on 16 Jul 2010 at 3:05

GoogleCodeExporter commented 9 years ago
Thanks, fixed in 1.50.

Original comment by lcam...@gmail.com on 16 Jul 2010 at 3:14