Skip to content
  1. Apr 07, 2019
    • Even Rouault's avatar
      multi_runsingle(): fix use-after-free · 64cbae31
      Even Rouault authored
      Fixes #3745
      Closes #3746
      
      The following snippet
      ```
      
      int main()
      {
          CURL* hCurlHandle = curl_easy_init();
          curl_easy_setopt(hCurlHandle, CURLOPT_URL, "http://example.com");
          curl_easy_setopt(hCurlHandle, CURLOPT_PROXY, "1");
          curl_easy_perform(hCurlHandle);
          curl_easy_cleanup(hCurlHandle);
          return 0;
      }
      ```
      triggers the following Valgrind warning
      
      ```
      ==4125== Invalid read of size 8
      ==4125==    at 0x4E7D1EE: Curl_llist_remove (llist.c:97)
      ==4125==    by 0x4E7EF5C: detach_connnection (multi.c:798)
      ==4125==    by 0x4E80545: multi_runsingle (multi.c:1451)
      ==4125==    by 0x4E8197C: curl_multi_perform (multi.c:2072)
      ==4125==    by 0x4E766A0: easy_transfer (easy.c:625)
      ==4125==    by 0x4E76915: easy_perform (easy.c:719)
      ==4125==    by 0x4E7697C: curl_easy_perform (easy.c:738)
      ==4125==    by 0x4008BE: main (in /home/even/curl/test)
      ==4125==  Address 0x9b3d1d0 is 1,120 bytes inside a block of size 1,600 free'd
      ==4125==    at 0x4C2ECF0: free (vg_replace_malloc.c:530)
      ==4125==    by 0x4E62C36: conn_free (url.c:756)
      ==4125==    by 0x4E62D34: Curl_disconnect (url.c:818)
      ==4125==    by 0x4E48DF9: Curl_once_resolved (hostip.c:1097)
      ==4125==    by 0x4E8052D: multi_runsingle (multi.c:1446)
      ==4125==    by 0x4E8197C: curl_multi_perform (multi.c:2072)
      ==4125==    by 0x4E766A0: easy_transfer (easy.c:625)
      ==4125==    by 0x4E76915: easy_perform (easy.c:719)
      ==4125==    by 0x4E7697C: curl_easy_perform (easy.c:738)
      ==4125==    by 0x4008BE: main (in /home/even/curl/test)
      ==4125==  Block was alloc'd at
      ==4125==    at 0x4C2F988: calloc (vg_replace_malloc.c:711)
      ==4125==    by 0x4E6438E: allocate_conn (url.c:1654)
      ==4125==    by 0x4E685B4: create_conn (url.c:3496)
      ==4125==    by 0x4E6968F: Curl_connect (url.c:4023)
      ==4125==    by 0x4E802E7: multi_runsingle (multi.c:1368)
      ==4125==    by 0x4E8197C: curl_multi_perform (multi.c:2072)
      ==4125==    by 0x4E766A0: easy_transfer (easy.c:625)
      ==4125==    by 0x4E76915: easy_perform (easy.c:719)
      ==4125==    by 0x4E7697C: curl_easy_perform (easy.c:738)
      ==4125==    by 0x4008BE: main (in /home/even/curl/test)
      ```
      
      This has been bisected to commit 2f44e94e
      
      Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=14109
      Credit to OSS Fuzz
      64cbae31
  2. Apr 06, 2019
  3. Apr 05, 2019
  4. Apr 04, 2019
  5. Apr 03, 2019
  6. Apr 02, 2019
  7. Apr 01, 2019
  8. Mar 31, 2019
  9. Mar 28, 2019
  10. Mar 27, 2019
  11. Mar 26, 2019
  12. Mar 25, 2019
  13. Mar 24, 2019
  14. Mar 22, 2019
  15. Mar 20, 2019
  16. Mar 18, 2019
  17. Mar 17, 2019
  18. Mar 15, 2019