Skip to content
This repository has been archived by the owner on Sep 28, 2019. It is now read-only.

Commit

Permalink
Correct off by 1 in malloc, which causes this to fail on macOS (and i…
Browse files Browse the repository at this point in the history
…n theory on any platform).
  • Loading branch information
mwachs5 committed Dec 24, 2016
1 parent b474c22 commit ddb4caf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/flash/nor/fespi.c
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ void as_add_tx(struct algorithm_steps *as, unsigned count, const uint8_t *data)
while (count > 0) {
unsigned step_count = MIN(count, 255);
assert(as->used < as->size);
as->steps[as->used] = malloc(step_count + 1);
as->steps[as->used] = malloc(step_count + 2);
as->steps[as->used][0] = STEP_TX;
as->steps[as->used][1] = step_count;
memcpy(as->steps[as->used] + 2, data, step_count);
Expand Down

0 comments on commit ddb4caf

Please sign in to comment.