1. 07 Apr, 2019 1 commit
    • 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. 06 Apr, 2019 4 commits
  3. 05 Apr, 2019 4 commits
  4. 04 Apr, 2019 1 commit
  5. 03 Apr, 2019 2 commits
  6. 02 Apr, 2019 2 commits
  7. 01 Apr, 2019 2 commits
  8. 31 Mar, 2019 2 commits
  9. 28 Mar, 2019 1 commit
  10. 27 Mar, 2019 4 commits
  11. 26 Mar, 2019 3 commits
  12. 25 Mar, 2019 2 commits
  13. 24 Mar, 2019 3 commits
  14. 22 Mar, 2019 3 commits
  15. 20 Mar, 2019 2 commits
  16. 18 Mar, 2019 1 commit
  17. 17 Mar, 2019 2 commits
  18. 15 Mar, 2019 1 commit