1
0
mirror of https://github.com/moparisthebest/curl synced 2025-02-28 17:31:46 -05:00
Even Rouault 6e0e152ce5
parse_proxy(): fix memory leak in case of invalid proxy server name
Fixes the below leak:

$ valgrind --leak-check=full ~/install-curl-git/bin/curl --proxy "http://a:b@/x" http://127.0.0.1
curl: (5) Couldn't resolve proxy name
==5048==
==5048== HEAP SUMMARY:
==5048==     in use at exit: 532 bytes in 12 blocks
==5048==   total heap usage: 5,288 allocs, 5,276 frees, 445,271 bytes allocated
==5048==
==5048== 2 bytes in 1 blocks are definitely lost in loss record 1 of 12
==5048==    at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==5048==    by 0x4E6CB79: parse_login_details (url.c:5614)
==5048==    by 0x4E6BA82: parse_proxy (url.c:5091)
==5048==    by 0x4E6C46D: create_conn_helper_init_proxy (url.c:5346)
==5048==    by 0x4E6EA18: create_conn (url.c:6498)
==5048==    by 0x4E6F9B4: Curl_connect (url.c:6967)
==5048==    by 0x4E86D05: multi_runsingle (multi.c:1436)
==5048==    by 0x4E88432: curl_multi_perform (multi.c:2160)
==5048==    by 0x4E7C515: easy_transfer (easy.c:708)
==5048==    by 0x4E7C74A: easy_perform (easy.c:794)
==5048==    by 0x4E7C7B1: curl_easy_perform (easy.c:813)
==5048==    by 0x414025: operate_do (tool_operate.c:1563)
==5048==
==5048== 2 bytes in 1 blocks are definitely lost in loss record 2 of 12
==5048==    at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==5048==    by 0x4E6CBB6: parse_login_details (url.c:5621)
==5048==    by 0x4E6BA82: parse_proxy (url.c:5091)
==5048==    by 0x4E6C46D: create_conn_helper_init_proxy (url.c:5346)
==5048==    by 0x4E6EA18: create_conn (url.c:6498)
==5048==    by 0x4E6F9B4: Curl_connect (url.c:6967)
==5048==    by 0x4E86D05: multi_runsingle (multi.c:1436)
==5048==    by 0x4E88432: curl_multi_perform (multi.c:2160)
==5048==    by 0x4E7C515: easy_transfer (easy.c:708)
==5048==    by 0x4E7C74A: easy_perform (easy.c:794)
==5048==    by 0x4E7C7B1: curl_easy_perform (easy.c:813)
==5048==    by 0x414025: operate_do (tool_operate.c:1563)

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2984
Credit to OSS Fuzz for discovery

Closes #1761
2017-08-11 11:52:56 +02:00
..
2016-10-18 13:59:54 +02:00
2017-03-26 23:56:23 +02:00
2017-03-26 23:56:23 +02:00
2017-04-22 11:25:27 +02:00
2017-03-13 23:11:45 +01:00
2017-03-13 23:11:45 +01:00
2017-03-13 23:11:45 +01:00
2017-03-13 23:11:45 +01:00
2017-03-26 23:56:23 +02:00
2017-07-28 16:41:29 +02:00
2017-06-30 10:17:27 +02:00
2017-08-06 23:42:50 +02:00
2017-03-13 23:11:45 +01:00
2017-04-22 11:25:27 +02:00
2017-04-22 11:25:27 +02:00
2017-05-11 10:04:01 +02:00
2017-04-22 11:25:27 +02:00
2017-06-19 09:27:42 +02:00
2017-06-30 10:17:27 +02:00
2017-04-22 11:25:27 +02:00
2017-04-22 11:25:27 +02:00
2017-03-13 23:11:45 +01:00
2017-03-26 23:56:23 +02:00
2017-06-30 10:27:41 +02:00
2017-06-18 23:57:45 +02:00
2016-12-21 11:07:26 +01:00
2017-06-30 10:17:27 +02:00
2017-07-10 10:22:34 +02:00
2017-04-22 11:25:27 +02:00
2017-03-26 23:56:23 +02:00
2017-06-21 07:46:21 +02:00
2017-08-01 13:39:38 +02:00
2017-06-08 10:50:47 +02:00
2017-08-03 10:04:16 +02:00
2017-03-13 23:11:45 +01:00
2017-03-26 23:56:23 +02:00
2017-05-01 22:55:29 +02:00
2017-06-30 10:17:27 +02:00
2017-06-30 10:17:27 +02:00
2017-06-30 10:17:27 +02:00
2016-12-24 23:35:43 +01:00
2017-06-30 10:17:27 +02:00
2017-03-13 23:11:45 +01:00
2017-03-26 23:56:23 +02:00
2017-02-28 09:10:18 +01:00