Skip to content

Commit

Permalink
Merge pull request #9382 from brenodantas10/master
Browse files Browse the repository at this point in the history
Fix IPS patch after a099812 commit
  • Loading branch information
inactive123 committed Aug 28, 2019
2 parents 073d612 + 33c681c commit 90ba789
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tasks/task_patch.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ static enum patch_error bps_apply_patch(
uint8_t *prov=(uint8_t*)malloc((size_t)modify_target_size);
if (prov!=NULL){
free(*target_data);
bps.target_data=prov;
bps.target_data=prov;
*target_data=prov;
bps.target_length=modify_target_size;
}else
Expand Down Expand Up @@ -433,10 +433,10 @@ static enum patch_error ups_apply_patch(
static enum patch_error ips_apply_patch(
const uint8_t *patchdata, uint64_t patchlen,
const uint8_t *sourcedata, uint64_t sourcelength,
uint8_t **targetdata, uint64_t *targetlength)
uint8_t **targetdata_fix, uint64_t *targetlength)
{
uint32_t offset = 5;

uint8_t* targetdata=*targetdata_fix;
if (patchlen < 8 ||
patchdata[0] != 'P' ||
patchdata[1] != 'A' ||
Expand All @@ -445,7 +445,7 @@ static enum patch_error ips_apply_patch(
patchdata[4] != 'H')
return PATCH_PATCH_INVALID;

memcpy(*targetdata, sourcedata, (size_t)sourcelength);
memcpy(targetdata, sourcedata, (size_t)sourcelength);

*targetlength = sourcelength;

Expand Down Expand Up @@ -487,7 +487,7 @@ static enum patch_error ips_apply_patch(
break;

while (length--)
*targetdata[address++] = patchdata[offset++];
targetdata[address++] = patchdata[offset++];
}
else /* RLE */
{
Expand All @@ -501,7 +501,7 @@ static enum patch_error ips_apply_patch(
break;

while (length--)
*targetdata[address++] = patchdata[offset];
targetdata[address++] = patchdata[offset];

offset++;
}
Expand Down

0 comments on commit 90ba789

Please sign in to comment.