mirror of
https://github.com/curl/curl.git
synced 2026-07-24 14:27:16 +03:00
curl: improve the existing file check with -J
Previously a file that isn't user-readable but is user-writable would not be properly avoided and would get overwritten. Reported-by: BrumBrum on hackerone Assisted-by: Jay Satiro Bug: https://hackerone.com/reports/926638 Closes #5731
This commit is contained in:
parent
2b6b843bb1
commit
81b4e99b1e
3 changed files with 36 additions and 10 deletions
|
|
@ -456,6 +456,16 @@ FILE *curl_dbg_fopen(const char *file, const char *mode,
|
|||
return res;
|
||||
}
|
||||
|
||||
FILE *curl_dbg_fdopen(int filedes, const char *mode,
|
||||
int line, const char *source)
|
||||
{
|
||||
FILE *res = fdopen(filedes, mode);
|
||||
if(source)
|
||||
curl_dbg_log("FILE %s:%d fdopen(\"%d\",\"%s\") = %p\n",
|
||||
source, line, filedes, mode, (void *)res);
|
||||
return res;
|
||||
}
|
||||
|
||||
int curl_dbg_fclose(FILE *file, int line, const char *source)
|
||||
{
|
||||
int res;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue