Write more tests attempting to break windows

This time I haven't succeeded in breaking anything which is a good sign.
This commit is contained in:
Justine Tunney 2024-09-21 21:28:35 -07:00
parent 476926790a
commit 126a44dc49
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
7 changed files with 331 additions and 37 deletions

View file

@ -2276,7 +2276,7 @@ static struct Asset *GetAssetZip(const char *path, size_t pathlen) {
hash = Hash(path, pathlen);
for (step = 0;; ++step) {
i = (hash + ((step * (step + 1)) >> 1)) & (assets.n - 1);
if (!assets.p[i].hash)
if (i >= assets.n || !assets.p || !assets.p[i].hash)
return NULL;
if (hash == assets.p[i].hash &&
pathlen == ZIP_CFILE_NAMESIZE(zmap + assets.p[i].cf) &&