curl/tests/libtest
Even Rouault 55b51b8c49
Curl_dedotdotify(): always nul terminate returned string.
This fixes potential out-of-buffer access on "file:./" URL

$ valgrind curl "file:./"
==24516== Memcheck, a memory error detector
==24516== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==24516== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
==24516== Command: /home/even/install-curl-git/bin/curl file:./
==24516==
==24516== Conditional jump or move depends on uninitialised value(s)
==24516==    at 0x4C31F9C: strcmp (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==24516==    by 0x4EBB315: seturl (urlapi.c:801)
==24516==    by 0x4EBB568: parseurl (urlapi.c:861)
==24516==    by 0x4EBC509: curl_url_set (urlapi.c:1199)
==24516==    by 0x4E644C6: parseurlandfillconn (url.c:2044)
==24516==    by 0x4E67AEF: create_conn (url.c:3613)
==24516==    by 0x4E68A4F: Curl_connect (url.c:4119)
==24516==    by 0x4E7F0A4: multi_runsingle (multi.c:1440)
==24516==    by 0x4E808E5: curl_multi_perform (multi.c:2173)
==24516==    by 0x4E7558C: easy_transfer (easy.c:686)
==24516==    by 0x4E75801: easy_perform (easy.c:779)
==24516==    by 0x4E75868: curl_easy_perform (easy.c:798)

Was originally spotted by
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10637
Credit to OSS-Fuzz

Closes #3039
2018-09-24 07:48:41 +02:00
..
.gitignore libtest: Add chkdecimalpoint to .gitignore 2018-09-15 23:39:50 +02:00
chkdecimalpoint.c test1148: disable if decimal separator is not point 2018-08-21 19:00:48 +02:00
chkhostname.c
CMakeLists.txt test1148: disable if decimal separator is not point 2018-08-21 19:00:48 +02:00
first.c
lib500.c whitespace fixes 2018-09-23 22:24:02 +00:00
lib501.c whitespace fixes 2018-09-23 22:24:02 +00:00
lib502.c whitespace fixes 2018-09-23 22:24:02 +00:00
lib503.c whitespace fixes 2018-09-23 22:24:02 +00:00
lib504.c whitespace fixes 2018-09-23 22:24:02 +00:00
lib505.c
lib506.c whitespace fixes 2018-09-23 22:24:02 +00:00
lib507.c
lib508.c
lib509.c whitespace fixes 2018-09-23 22:24:02 +00:00
lib510.c
lib511.c
lib512.c whitespace fixes 2018-09-23 22:24:02 +00:00
lib513.c
lib514.c
lib515.c
lib516.c
lib517.c
lib518.c
lib519.c whitespace fixes 2018-09-23 22:24:02 +00:00
lib520.c
lib521.c whitespace fixes 2018-09-23 22:24:02 +00:00
lib523.c whitespace fixes 2018-09-23 22:24:02 +00:00
lib524.c whitespace fixes 2018-09-23 22:24:02 +00:00
lib525.c
lib526.c
lib530.c
lib533.c
lib536.c
lib537.c
lib539.c
lib540.c
lib541.c
lib542.c
lib543.c
lib544.c
lib547.c whitespace fixes 2018-09-23 22:24:02 +00:00
lib549.c whitespace fixes 2018-09-23 22:24:02 +00:00
lib552.c
lib553.c
lib554.c
lib555.c whitespace fixes 2018-09-23 22:24:02 +00:00
lib556.c whitespace fixes 2018-09-23 22:24:02 +00:00
lib557.c
lib558.c whitespace fixes 2018-09-23 22:24:02 +00:00
lib559.c whitespace fixes 2018-09-23 22:24:02 +00:00
lib560.c
lib562.c
lib564.c
lib566.c whitespace fixes 2018-09-23 22:24:02 +00:00
lib567.c whitespace fixes 2018-09-23 22:24:02 +00:00
lib568.c whitespace fixes 2018-09-23 22:24:02 +00:00
lib569.c whitespace fixes 2018-09-23 22:24:02 +00:00
lib570.c whitespace fixes 2018-09-23 22:24:02 +00:00
lib571.c whitespace fixes 2018-09-23 22:24:02 +00:00
lib572.c whitespace fixes 2018-09-23 22:24:02 +00:00
lib573.c whitespace fixes 2018-09-23 22:24:02 +00:00
lib574.c
lib575.c
lib576.c
lib578.c
lib579.c cppcheck: fix warnings 2018-06-11 11:14:48 +02:00
lib582.c
lib583.c
lib586.c whitespace fixes 2018-09-23 22:24:02 +00:00
lib589.c
lib590.c whitespace fixes 2018-09-23 22:24:02 +00:00
lib591.c
lib597.c
lib598.c whitespace fixes 2018-09-23 22:24:02 +00:00
lib599.c
lib643.c
lib650.c curl-compilers: enable -Wbad-function-cast on GCC 2018-08-21 18:53:45 +02:00
lib651.c
lib652.c
lib653.c
lib654.c
lib655.c
lib1156.c http resume: skip body if http code 416 (range error) is ignored. 2018-05-22 13:23:02 +02:00
lib1500.c
lib1501.c
lib1502.c lib1502: fix memory leak in torture test 2018-08-10 16:16:06 +02:00
lib1506.c
lib1507.c whitespace fixes 2018-09-23 22:24:02 +00:00
lib1508.c
lib1509.c
lib1510.c
lib1511.c
lib1512.c whitespace fixes 2018-09-23 22:24:02 +00:00
lib1513.c
lib1514.c
lib1515.c
lib1517.c
lib1520.c whitespace fixes 2018-09-23 22:24:02 +00:00
lib1522.c lib1522: fix curl_easy_setopt argument type 2018-08-24 21:06:26 +02:00
lib1525.c
lib1526.c whitespace fixes 2018-09-23 22:24:02 +00:00
lib1527.c
lib1528.c
lib1529.c
lib1530.c
lib1531.c whitespace fixes 2018-09-23 22:24:02 +00:00
lib1532.c
lib1533.c whitespace fixes 2018-09-23 22:24:02 +00:00
lib1534.c
lib1535.c
lib1536.c
lib1537.c cppcheck: fix warnings 2018-06-11 11:14:48 +02:00
lib1538.c
lib1540.c test1540: Remove unused macro TEST_HANG_TIMEOUT 2018-08-09 12:37:21 +02:00
lib1550.c
lib1551.c
lib1552.c
lib1553.c
lib1554.c cppcheck: fix warnings 2018-06-11 11:14:48 +02:00
lib1555.c
lib1556.c
lib1557.c multi: fix crash due to dangling entry in connect-pending list 2018-06-23 22:31:52 +02:00
lib1560.c Curl_dedotdotify(): always nul terminate returned string. 2018-09-24 07:48:41 +02:00
lib1900.c cppcheck: fix warnings 2018-06-11 11:14:48 +02:00
libauthretry.c whitespace fixes 2018-09-23 22:24:02 +00:00
libntlmconnect.c general: fix printf specifiers 2018-08-01 14:08:00 +02:00
Makefile.am whitespace fixes 2018-09-23 22:24:02 +00:00
Makefile.inc URL-API 2018-09-08 15:36:11 +02:00
mk-lib1521.pl
notexists.pl
sethostname.c
sethostname.h whitespace fixes 2018-09-23 22:24:02 +00:00
stub_gssapi.c
stub_gssapi.h whitespace fixes 2018-09-23 22:24:02 +00:00
test75.pl
test307.pl
test610.pl
test613.pl
test1013.pl
test1022.pl
test.h
testtrace.c whitespace fixes 2018-09-23 22:24:02 +00:00
testtrace.h whitespace fixes 2018-09-23 22:24:02 +00:00
testutil.c
testutil.h whitespace fixes 2018-09-23 22:24:02 +00:00