Bug 969226 - Check if there is enough data to read u32 to avoid buffer overflow. r=bgirard

This commit is contained in:
Jeff Muizelaar 2014-04-09 15:20:18 -04:00
parent 47dcbf2ce9
commit 88c1aa8292

View File

@ -1020,6 +1020,9 @@ qcms_profile* qcms_profile_from_memory(const void *mem, size_t size)
source.size = size;
source.valid = true;
if (size < 4)
return INVALID_PROFILE;
length = read_u32(src, 0);
if (length <= size) {
// shrink the area that we can read if appropriate