protect against null-path (#8915)

Co-authored-by: Vladimir Dombrovski <vladimir.dombrovski@bso.co>
Co-authored-by: Vishesh <vishesh92@gmail.com>
Co-authored-by: Suresh Kumar Anaparti <sureshkumar.anaparti@gmail.com>
This commit is contained in:
dahn 2024-04-19 12:23:31 +02:00 committed by GitHub
parent d4a5459a83
commit 7affbb1dac
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 2 deletions

View File

@ -3066,7 +3066,10 @@ public class VmwareResource extends ServerResourceBase implements StoragePoolRes
}
private String appendFileType(String path, String fileType) {
if (path.toLowerCase().endsWith(fileType.toLowerCase())) {
if (StringUtils.isBlank(path)) {
throw new CloudRuntimeException("No path given, cannot append filetype " + fileType);
}
if (fileType == null || path.toLowerCase().endsWith(fileType.toLowerCase())) {
return path;
}

View File

@ -4,6 +4,6 @@
notifempty
maxsize 10M
postrotate
/bin/kill -HUP `cat /var/run/rsyslog.pid 2> /dev/null` 2> /dev/null || true
/usr/lib/rsyslog/rsyslog-rotate
endscript
}