Skip to content

Commit

Permalink
Fix potentially dangerous memcpy (#195)
Browse files Browse the repository at this point in the history
  • Loading branch information
Xenoamor authored and kanflo committed Oct 20, 2019
1 parent c548a92 commit 66f4eaf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion opendps/uframe.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ int32_t uframe_extract_payload(frame_t *frame, uint8_t *data, uint32_t length)
}
} while(0);

if (status != -E_CRC)
if (status >= 0)
{
memcpy(frame->buffer, data, status);
frame->length = status;
Expand Down

0 comments on commit 66f4eaf

Please sign in to comment.