Hardening suggestions for Stirling-PDF / enterpriseStuff (#3244)

I've reviewed the recently opened PR ([3241 - Security fixes, enterprise
stuff and
more](https://github.com/Stirling-Tools/Stirling-PDF/pull/3241)) and
have identified some area(s) that could benefit from additional
hardening measures.

These changes should help prevent potential security vulnerabilities and
improve overall code quality.

Thank you for your consideration!
🧚🤖  Powered by Pixeebot  

[Feedback](https://ask.pixee.ai/feedback) |
[Community](https://pixee-community.slack.com/signup#/domain-signup) |
[Docs](https://docs.pixee.ai/)
![](https://d1zaessa2hpsmj.cloudfront.net/pixel/v1/track?writeKey=2PI43jNm7atYvAuK7rJUz3Kcd6A&event=PR_HARDENING%7CStirling-Tools%2FStirling-PDF%7Cdfd567b803641d60be14c58dae67802e726ece1c)

Co-authored-by: pixeebot[bot] <104101892+pixeebot[bot]@users.noreply.github.com>
This commit is contained in:
pixeebot[bot] 2025-03-25 17:50:26 +00:00 committed by GitHub
parent c2bfca762f
commit 62139e4161
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -148,7 +148,7 @@ public class MergeController {
mergerUtility.addSource(tempFile); // Add source file to the merger utility
}
mergedTempFile = File.createTempFile("merged-", ".pdf");
mergedTempFile = Files.createTempFile("merged-", ".pdf").toFile();
mergerUtility.setDestinationFileName(mergedTempFile.getAbsolutePath());
mergerUtility.mergeDocuments(