diff --git a/dependency/libcurl/CVE-2024-11053.patch b/dependency/libcurl/CVE-2024-11053.patch new file mode 100644 index 0000000000000000000000000000000000000000..509f2897df1db7a5c4a504b66dfd03deea79940a --- /dev/null +++ b/dependency/libcurl/CVE-2024-11053.patch @@ -0,0 +1,43 @@ +diff -Naur a/lib/netrc.c b/lib/netrc.c +--- a/lib/netrc.c 2025-01-14 17:14:55.777274912 +0800 ++++ b/lib/netrc.c 2025-01-14 17:22:31.244203060 +0800 +@@ -152,6 +152,7 @@ + retcode = NETRC_FAILED; /* allocation failed */ + goto out; + } ++ state_our_login = TRUE; + login_alloc = TRUE; + } + state_login = 0; +@@ -181,6 +182,16 @@ + state = HOSTFOUND; + state_our_login = FALSE; + } ++ else if(strcasecompare("default", tok)) { ++ state = HOSTVALID; ++ retcode = NETRC_SUCCESS; /* we did find our host */ ++ Curl_safefree(password); ++ if(!specific_login) ++ if(login_alloc) { ++ free(login); ++ login_alloc = FALSE; ++ } ++ } + break; + } /* switch (state) */ + +@@ -189,6 +200,14 @@ + } /* while fgets() */ + + out: ++ if(!retcode && !password && state_our_login) { ++ /* success without a password, set a blank one */ ++ password = strdup(""); ++ if(!password) ++ retcode = 1; /* out of memory */ ++ else ++ password_alloc = TRUE; ++ } + if(!retcode) { + /* success */ + *login_changed = FALSE; diff --git a/dependency/libcurl/build.sh b/dependency/libcurl/build.sh index c56cf77f76fc9f317d0fd7cb27e9c33eab530865..74e7d85651662c72e382ef94447d94d5865db3cd 100644 --- a/dependency/libcurl/build.sh +++ b/dependency/libcurl/build.sh @@ -125,6 +125,7 @@ main() patch -p1 < ../CVE-2023-38545.patch >> $LOG_FILE 2>&1 patch -p1 < ../CVE-2024-2398.patch >> $LOG_FILE 2>&1 patch -p1 < ../CVE-2024-9681.patch >> $LOG_FILE 2>&1 + patch -p1 < ../CVE-2024-11053.patch >> $LOG_FILE 2>&1 checkret "Failed to patch huawei_curl.patch" print_done