Skip to content

Commit

Permalink
wildcards: add some warnings for pitfalls
Browse files Browse the repository at this point in the history
  • Loading branch information
lazka committed Nov 9, 2024
1 parent 77a4693 commit 8261376
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions web/docs/c.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@ link [w]setargv.obj to your program. By default it is not enabled. For more
details see
https://learn.microsoft.com/en-us/cpp/c-language/expanding-wildcard-arguments

Note that enabling wildcard expansion can have usability and security
implications:

* The program might transform the arguments you passed in, depending on the
current directory, leading to user confusion.
* The program might leak information about the existence and names of files on
the filesystem.
* Input validation might be bypassed if wildcard expansions is not taken into
account.

With mingw-w64, there are three ways wildcard expansion can be configured:

1. You can set `_dowildcard` in your source code to either `0` or `-1` to disable or enable wildcard expansion.
Expand Down

0 comments on commit 8261376

Please sign in to comment.