Fix oob write in dyldcache accel loading (#3534)

This commit is contained in:
Florian Märkl 2023-05-28 22:17:20 +02:00 committed by GitHub
parent 86511a16c9
commit c5978e158c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -572,6 +572,10 @@ static RzList /*<RzDyldBinImage *>*/ *create_cache_bins(RzDyldCache *cache) {
break;
}
ut16 dep_index = dep_array[k] & 0x7fff;
if (dep_index >= cache->hdr->imagesCount) {
RZ_LOG_ERROR("dyldcache: depList contents overflow\n");
break;
}
deps[dep_index]++;
char *dep_name = get_lib_name(cache->buf, &img[dep_index]);