Update app/core/src/main/java/stirling/software/SPDF/controller/api/misc/StampController.java

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Ludy 2025-08-02 12:53:32 +02:00 committed by GitHub
parent ceb3155ff7
commit 3542da1b5a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -72,7 +72,7 @@ public class StampController {
MultipartFile stampImage = request.getStampImage();
if ("image".equalsIgnoreCase(stampType)) {
String stampImageName = stampImage.getOriginalFilename();
if (stampImageName.contains("..") || stampImageName.startsWith("/")) {
if (stampImageName == null || stampImageName.contains("..") || stampImageName.startsWith("/")) {
throw new IllegalArgumentException("Invalid stamp image file path");
}
}