Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patchwork PR: AutoFix #813

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion patchwork/common/client/patched.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ async def _public_telemetry(self, patchflow: str, inputs: dict[str, Any]):
is_container=is_container(),
),
),
timeout=10
)

def send_public_telemetry(self, patchflow: str, inputs: dict):
try:
_thread = Thread(target=asyncio.run, args=(self._public_telemetry(patchflow, inputs),))
Expand Down
4 changes: 2 additions & 2 deletions patchwork/steps/ExtractDiff/ExtractDiff.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def run(self) -> dict:
name = namespace + ":" + name
vuln_version = update_info["vuln_version"]
fixed_version = update_info["fixed_version"]
info = requests.get(self.libraries_base_url + platform_type + "/" + name + "?api_key=" + self.libraries_api_key)
info = requests.get(self.libraries_base_url + platform_type + "/" + name + "?api_key=" + self.libraries_api_key, timeout=10)
if info.status_code != 200:
logger.info(f"Unable to get repo url for library {name}")
return {}
Expand All @@ -204,7 +204,7 @@ def run(self) -> dict:
temp_file_path = None

for vuln_version, fixed_version in generate_version_combinations(vuln_version, fixed_version):
diff_file = requests.get(compare_url + vuln_version + "..." + fixed_version, headers=headers)
diff_file = requests.get(compare_url + vuln_version + "..." + fixed_version, headers=headers, timeout=10)

if diff_file.text.startswith("diff"):
with defered_temp_file("w") as fp:
Expand Down
9 changes: 8 additions & 1 deletion patchwork/steps/GetTypescriptTypeInfo/get_type_info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,14 @@ function main() {
process.exit(1);
}

const basePath = '/app/restricted/';
const joinedPath = path.join(basePath, crypto.randomUUID());
const fullPath = path.normalize(joinedPath);
if (!fullPath.startsWith(basePath)) {
console.log("Invalid path specified!");
process.exit(1);
}

console.log(
"Getting type info for",
identifier,
Expand All @@ -281,5 +289,4 @@ function main() {
console.error(`Error writing to file: ${error}`);
}
}

main();
Loading