Skip to content

Commit

Permalink
fix OOB if hashCdoe is too small
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasKaminsky committed Nov 16, 2016
1 parent 2ffafc2 commit 4dc3ad2
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ protected int uploadFile(OwnCloudClient client) throws IOException {

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 {
Expand Down

0 comments on commit 4dc3ad2

Please sign in to comment.