Mojira Archive
MC-172023

Potential race condition in ClientPackSource.downloadAndSelectResourcePack

The bug

There appears to be a potential race condition in net.minecraft.client.resources.ClientPackSource.downloadAndSelectResourcePack(String, String) (Mojang name).

  1. If a resource pack does not exist yet it is downloaded asynchronously.
  2. However, if the method is called again while the download is still in progress, it will incorrectly assume it was completely downloaded because the file exists.
  3. Since the file is not complete yet, either there is a hash mismatch (if a hash is provided) or setServerPack fails because the zip is malformed.
  4. The resource pack is therefore deleted.

The end result can therefore be that both downloadAndSelectResourcePack calls fail.

Unresolved

Marcono1234

2020-02-13, 05:51 PM

2023-10-26, 06:46 PM

5

2

Plausible

Low

Platform

Resource Packs

20w06a

-