mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
Add more checks for valid ld.so.cache file (bug 18093)
This commit is contained in:
@ -199,6 +199,11 @@ print_cache (const char *cache_name)
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Check for corruption, avoiding overflow. */
|
||||
if ((cache_size - sizeof (struct cache_file)) / sizeof (struct file_entry)
|
||||
< cache->nlibs)
|
||||
error (EXIT_FAILURE, 0, _("File is not a cache file.\n"));
|
||||
|
||||
size_t offset = ALIGN_CACHE (sizeof (struct cache_file)
|
||||
+ (cache->nlibs
|
||||
* sizeof (struct file_entry)));
|
||||
|
Reference in New Issue
Block a user