mkrasimage: fix segmentation fault
authorMichael T Farnworth <michael@turf.org>
Sat, 22 Feb 2020 14:20:49 +0000 (14:20 +0000)
committerPetr Štetiar <ynezz@true.cz>
Sun, 1 Mar 2020 20:36:00 +0000 (21:36 +0100)
commit7bb4e3967046009d3d8992b77373bc517b4f8333
treece2763bcf2672b6f0b3c85e9604ecedeca0dae1c
parenta32d871ea0f7f5b3915ec10cd4824f02500bf994
mkrasimage: fix segmentation fault

Code was attempting to determine the size of the file
before it was actually known and allocating insufficient
memory space.  Images above a certain size caused a
segmentation fault.  Moving the calloc() ensured ensured
that large images didn't result in a buffer overflow on
memcpy().

Signed-off-by: Michael T Farnworth <michael@turf.org>
[fixed name in From to match one in SoB]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
src/mkrasimage.c