Skip to content

Commit

Permalink
Fix: malloc memory area for ioprp_image too small
Browse files Browse the repository at this point in the history
  • Loading branch information
rickgaiser committed Sep 8, 2019
1 parent 2c43035 commit 54bce08
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/system.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ extern int size_elfldr_elf;
extern unsigned char IOPRP_img[];
extern unsigned int size_IOPRP_img;

extern unsigned char eesync_irx[];
extern unsigned int size_eesync_irx;

#define MAX_MODULES 32
static void *g_sysLoadedModBuffer[MAX_MODULES];

Expand Down Expand Up @@ -459,8 +462,11 @@ static unsigned int sendIrxKernelRAM(const char *startup, const char *mode_str,

irxtable = (irxtab_t *)ModuleStorage;
irxptr_tab = (irxptr_t *)((unsigned char *)irxtable + sizeof(irxtab_t));
ioprp_image = malloc(size_IOPRP_img + size_cdvdman_irx + size_cdvdfsv_irx + 256);
size_ioprp_image = size_IOPRP_img + size_cdvdman_irx + size_cdvdfsv_irx + size_eesync_irx + 256;
LOG("IOPRP image size calculated: %d\n", size_ioprp_image);
ioprp_image = malloc(size_ioprp_image);
size_ioprp_image = patch_IOPRP_image(ioprp_image, cdvdman_irx, size_cdvdman_irx);
LOG("IOPRP image size actual: %d\n", size_ioprp_image);

modcount = 0;
//Basic modules
Expand Down

0 comments on commit 54bce08

Please sign in to comment.