carefully crafted cache file sizes can trigger assert
|Reported by:||arma||Owned by:|
|Actual Points:||Parent ID:|
In read_file_to_str() we do
if ((uint64_t)(statbuf.st_size)+1 > SIZE_T_CEILING) return NULL; string = tor_malloc((size_t)(statbuf.st_size+1));
So a remote attacker who can give you a combination of cached blobs such that one of your files becomes exactly SIZE_T_CEILING bytes (just 2 gigs on a 32 bit platform) could cause your Tor to consistently assert on start.
The fix is to check >= instead of >.
Reported by doors.