Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d8c19424 authored by tobiasKaminsky's avatar tobiasKaminsky
Browse files

fix OOB if hashCdoe is too small

parent 605b9b6d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -69,7 +69,7 @@ public class ChunkedUploadRemoteFileOperation extends UploadRemoteFileOperation

        File file = new File(mLocalPath);
        SharedPreferences sharedPref = mContext.getApplicationContext().getSharedPreferences("com.nextcloud.PREFERENCE_upload", Context.MODE_PRIVATE);
        String chunkId = String.valueOf(Math.abs(file.getName().hashCode())).substring(0,8);
        String chunkId = String.format("%08d", Math.abs(file.getName().hashCode()));
        Set<String> successfulChunks = sharedPref.getStringSet(chunkId, new LinkedHashSet<String>());

        try {