mirror of
https://github.com/signalapp/Signal-Server
synced 2026-04-20 02:28:03 +01:00
Add source length validation on backup media copy
This commit is contained in:
committed by
ravi-signal
parent
6cdfb7ab63
commit
fd10b9723d
@@ -273,7 +273,7 @@ public class BackupManager {
|
||||
final List<CopyParameters> toCopy) {
|
||||
final long totalBytesAdded = toCopy.stream()
|
||||
.mapToLong(copyParameters -> {
|
||||
if (copyParameters.sourceLength() > MAX_MEDIA_OBJECT_SIZE) {
|
||||
if (copyParameters.sourceLength() > MAX_MEDIA_OBJECT_SIZE || copyParameters.sourceLength() < 0) {
|
||||
throw Status.INVALID_ARGUMENT
|
||||
.withDescription("Invalid sourceObject size")
|
||||
.asRuntimeException();
|
||||
|
||||
Reference in New Issue
Block a user