summaryrefslogtreecommitdiff
path: root/lib/curl_fnmatch.c
Commit message (Collapse)AuthorAgeFilesLines
* copyright: update all copyright lines and remove year rangesDaniel Stenberg2023-01-031-1/+1
| | | | | | | | | | | | - they are mostly pointless in all major jurisdictions - many big corporations and projects already don't use them - saves us from pointless churn - git keeps history for us - the year range is kept in COPYING checksrc is updated to allow non-year using copyright statements Closes #10205
* lib: fix some type mismatches and remove unneeded typecastsRose2022-11-081-4/+3
| | | | | | | | | Many of these castings are unneeded if we change the variables to work better with each other. Ref: https://github.com/curl/curl/pull/9823 Closes https://github.com/curl/curl/pull/9835
* copyright: make repository REUSE compliantmax.mehl2022-06-131-1/+3
| | | | | | | | | | | Add licensing and copyright information for all files in this repository. This either happens in the file itself as a comment header or in the file `.reuse/dep5`. This commit also adds a Github workflow to check pull requests and adapts copyright.pl to the changes. Closes #8869
* copyright: fix year rangesDaniel Stenberg2020-11-051-1/+1
| | | | Follow-up from 4d2f8006777
* curl.se: new homeDaniel Stenberg2020-11-041-1/+1
| | | | Closes #6172
* cleanup: remove FIXME and TODO commentsDaniel Stenberg2019-05-161-9/+0
| | | | | | | | | They serve very little purpose and mostly just add noise. Most of them have been around for a very long time. I read them all before removing or rephrasing them. Ref: #3876 Closes #3883
* fnmatch: disable if FTP is disabledDaniel Stenberg2019-02-121-2/+4
| | | | Closes #3551
* spelling fixesViktor Szakats2018-06-031-1/+1
| | | | | | Detected using the `codespell` tool (version 1.13.0). Also secure and fix an URL.
* fnmatch: use the system one if availableDaniel Stenberg2018-06-011-0/+37
| | | | | | | | | | | | | If configure detects fnmatch to be available, use that instead of our custom one for FTP wildcard pattern matching. For standard compliance, to reduce our footprint and to use already well tested and well exercised code. A POSIX fnmatch behaves slightly different than the internal function for a few test patterns currently and the macOS one yet slightly different. Test case 1307 is adjusted for these differences. Closes #2626
* fnmatch: insist on escaped bracket to matchDaniel Stenberg2018-05-281-2/+2
| | | | | | | | | | | | A non-escaped bracket ([) is for a character group - as documented. It will *not* match an individual bracket anymore. Test case 1307 updated accordingly to match. Problem detected by OSS-Fuzz, although this fix is probably not a final fix for the notorious timeout issues. Bug: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=8525 Closes #2614
* curl_fnmatch: only allow two asterisks for matchingDaniel Stenberg2018-05-181-1/+1
| | | | | | | | | | | | | The previous limit of 5 can still end up in situation that takes a very long time and consumes a lot of CPU. If there is still a rare use case for this, a user can provide their own fnmatch callback for a version that allows a larger set of wildcards. This commit was triggered by yet another OSS-Fuzz timeout due to this. Bug: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=8369 Closes #2587
* fnmatch: optimize processing of consecutive *s and ?s pattern charactersPatrick Monnerat2018-02-071-13/+18
| | | | | | Reported-By: Daniel Stenberg Fixes #2291 Closes #2293
* fnmatch: pattern syntax can no longer failPatrick Monnerat2018-01-311-113/+80
| | | | | | | | | | | | Whenever an expected pattern syntax rule cannot be matched, the character starting the rule loses its special meaning and the parsing is resumed: - backslash at the end of pattern string matches itself. - Error in [:keyword:] results in set containing :\[dekorwy. Unit test 1307 updated for this new situation. Closes #2273
* fnmatch: accept an alphanum to be followed by a non-alphanum in char setPatrick Monnerat2018-01-311-90/+53
| | | | | | | Also be more tolerant about set pattern syntax. Update unit test 1307 accordingly. Bug: https://curl.haxx.se/mail/lib-2018-01/0114.html
* fnmatch: do not match the empty string with a character setPatrick Monnerat2018-01-311-3/+3
|
* curl_fnmatch: only allow 5 '*' sections in a single patternDaniel Stenberg2018-01-171-3/+7
| | | | | ... to avoid excessive recursive calls. The number 5 is totally arbitrary and could be modified if someone has a good motivation.
* ftp-wildcard: fix matching an empty string with "*[^a]"Daniel Stenberg2018-01-171-2/+4
| | | | | | | | .... and avoid advancing the pointer to trigger an out of buffer read. Detected by OSS-fuzz Bug: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=5251 Assisted-by: Max Dymond
* wildcardmatch: fix heap buffer overflow in setcharsetDaniel Stenberg2017-11-271-6/+3
| | | | | | | | | | | | | The code would previous read beyond the end of the pattern string if the match pattern ends with an open bracket when the default pattern matching function is used. Detected by OSS-Fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=4161 CVE-2017-8817 Bug: https://curl.haxx.se/docs/adv_2017-ae72.html
* fnmatch: remove dead codeDaniel Stenberg2017-11-061-6/+1
| | | | | | | There was a duplicate check for backslashes in the setcharset() function. Coverity CID 1420611
* curl_fnmatch: return error on illegal wildcard patternDaniel Stenberg2017-10-261-3/+5
| | | | | | | | | | ... instead of doing an infinite loop! Added test 1162 to verify. Reported-by: Max Dymond Fixes #2015 Closes #2017
* code style: use spaces around plusesDaniel Stenberg2017-09-111-6/+6
|
* Improve code readbilitySylvestre Ledru2017-03-131-5/+3
| | | | | | ... by removing the else branch after a return, break or continue. Closes #1310
* memdebug: Ensure curl/curl.h is included before curl_memory.hSteve Holme2016-04-011-1/+3
| | | | Follow up to commit 7db9782dd6.
* URLs: change all http:// URLs to https://Daniel Stenberg2016-02-031-1/+1
|
* mprintf.h: remove #ifdef CURLDEBUGDaniel Stenberg2015-03-031-5/+2
| | | | | ... and as a consequence, introduce curl_printf.h with that re-define magic instead and make all libcurl code use that instead.
* build: fix circular header inclusion with other packagesYang Tse2013-01-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit renames lib/setup.h to lib/curl_setup.h and renames lib/setup_once.h to lib/curl_setup_once.h. Removes the need and usage of a header inclusion guard foreign to libcurl. [1] Removes the need and presence of an alarming notice we carried in old setup_once.h [2] ---------------------------------------- 1 - lib/setup_once.h used __SETUP_ONCE_H macro as header inclusion guard up to commit ec691ca3 which changed this to HEADER_CURL_SETUP_ONCE_H, this single inclusion guard is enough to ensure that inclusion of lib/setup_once.h done from lib/setup.h is only done once. Additionally lib/setup.h has always used __SETUP_ONCE_H macro to protect inclusion of setup_once.h even after commit ec691ca3, this was to avoid a circular header inclusion triggered when building a c-ares enabled version with c-ares sources available which also has a setup_once.h header. Commit ec691ca3 exposes the real nature of __SETUP_ONCE_H usage in lib/setup.h, it is a header inclusion guard foreign to libcurl belonging to c-ares's setup_once.h The renaming this commit does, fixes the circular header inclusion, and as such removes the need and usage of a header inclusion guard foreign to libcurl. Macro __SETUP_ONCE_H no longer used in libcurl. 2 - Due to the circular interdependency of old lib/setup_once.h and the c-ares setup_once.h header, old file lib/setup_once.h has carried back from 2006 up to now days an alarming and prominent notice about the need of keeping libcurl's and c-ares's setup_once.h in sync. Given that this commit fixes the circular interdependency, the need and presence of mentioned notice is removed. All mentioned interdependencies come back from now old days when the c-ares project lived inside a curl subdirectory. This commit removes last traces of such fact.
* Revert changes relative to lib/*.[ch] recent renamingYang Tse2013-01-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts renaming and usage of lib/*.h header files done 28-12-2012, reverting 2 commits: f871de0... build: make use of 76 lib/*.h renamed files ffd8e12... build: rename 76 lib/*.h files This also reverts removal of redundant include guard (redundant thanks to changes in above commits) done 2-12-2013, reverting 1 commit: c087374... curl_setup.h: remove redundant include guard This also reverts renaming and usage of lib/*.c source files done 3-12-2013, reverting 3 commits: 13606bb... build: make use of 93 lib/*.c renamed files 5b6e792... build: rename 93 lib/*.c files 7d83dff... build: commit 13606bbfde follow-up 1 Start of related discussion thread: http://curl.haxx.se/mail/lib-2013-01/0012.html Asking for confirmation on pushing this revertion commit: http://curl.haxx.se/mail/lib-2013-01/0048.html Confirmation summary: http://curl.haxx.se/mail/lib-2013-01/0079.html NOTICE: The list of 2 files that have been modified by other intermixed commits, while renamed, and also by at least one of the 6 commits this one reverts follows below. These 2 files will exhibit a hole in history unless git's '--follow' option is used when viewing logs. lib/curl_imap.h lib/curl_smtp.h
* build: make use of 76 lib/*.h renamed filesYang Tse2012-12-281-2/+2
| | | | | | 76 private header files renamed to use our standard naming scheme. This change affects 322 files in libcurl's source tree.
* unittest: mark all unit tested functionsDaniel Stenberg2011-06-101-0/+3
| | | | | With "@unittest: [num]" in the header comment for each tested function. Shows we have a log way to go still...
* source cleanup: unify look, style and indent levelsDaniel Stenberg2011-04-271-2/+2
| | | | | By the use of a the new lib/checksrc.pl script that checks that our basic source style rules are followed.
* replace isprint() with ISPRINT()Yang Tse2010-06-101-1/+1
|
* include libcurl standard internal headersYang Tse2010-06-021-0/+7
|
* make setup.h first included fileYang Tse2010-06-021-1/+2
|
* fix compiler warning: enumerated type mixed with another typeYang Tse2010-05-311-1/+1
|
* lib: eliminate 'statement not reached' warningsKamil Dudka2010-05-281-1/+5
|
* curl_fnmatch: remove use of register keywordTor Arntsen2010-05-271-4/+4
| | | | | Using the 'register' keyword rarely improves anything with modern compilers and architectures.
* curl_fnmatch: Use int not bool when function returns intTor Arntsen2010-05-211-1/+1
| | | | | | bool in curl internals is unsigned char and should not be used to receive return value from functions returning int - this fails when using IBM VisualAge and Tru64 compilers.
* ftp wildcard: a new option CURLOPT_FNMATCH_DATAKamil Dudka2010-05-161-1/+3
|
* style: minor whitespace changeDaniel Stenberg2010-05-121-4/+4
|
* FTP: WILDCARDMATCH/CHUNKING/FNMATCH addedPavel Raiskup2010-05-121-0/+410