Fix crash in mkimxboot bootloader installation.

mkimxboot requires passing a structure which got extended with another field.
This wasn't adjusted in Rockbox Utility, causing an out of bound access to an
array, which results in a segfault.

Change-Id: I0252849ed0b41f1d8804537c053debc9b0ecd08d
This commit is contained in:
Dominik Riebeling 2012-06-09 22:03:43 +02:00
parent c4183e1d67
commit 1e2c6506fb
2 changed files with 4 additions and 0 deletions

View file

@ -331,6 +331,9 @@ enum imx_error_t mkimxboot(const char *infile, const char *bootfile,
const char *outfile, struct imx_option_t opt)
{
/* Dump tables */
if(opt.fw_variant > VARIANT_COUNT) {
return IMX_ERROR;
}
dump_imx_dev_info("[INFO] ");
/* compute MD5 sum of the file */
uint8_t file_md5sum[16];

View file

@ -49,6 +49,7 @@ void BootloaderThreadImx::run(void)
struct imx_option_t opt;
opt.debug = false;
opt.output = IMX_DUALBOOT;
opt.fw_variant = VARIANT_DEFAULT;
m_error = mkimxboot(m_inputfile.toLocal8Bit().constData(),
m_bootfile.toLocal8Bit().constData(),