Codebase list faad2 / 1b71a6b
fix heap-buffer-overflow in mp4read.c This originated from an integer overflow: If mp4config.frame.ents would be read-in with a value of (uint32t)(-1), it would overflow to 0 in the size calculation for the allocation in the next line. The malloc() function would then successfully return a pointer to a memory region of size 0, which will cause a segfault when written to. Fixes #57. Fabian Greffrath 3 years ago
1 changed file(s) with 4 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
343343 u32in();
344344 // Number of entries
345345 mp4config.frame.ents = u32in();
346 // fixme: check atom size
346
347 if (!(mp4config.frame.ents + 1))
348 return ERR_FAIL;
349
347350 mp4config.frame.data = malloc(sizeof(*mp4config.frame.data)
348351 * (mp4config.frame.ents + 1));
349352