-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix buffer overruns and endianness issues in decoder code.
There are two issues being fixed here: 1) The code was checking that it had at least one more byte available to read, but then reading multiple bytes in some cases. 2) The code was reading the data (which is little-endian) via memcpy, which would not do the right thing on big-endian systems. The former problem is fixed by checking that we can read the number of bytes we plan to read; the latter problem is fixed by using ChipEncoding to read the data explicitly as little-endian data.
- Loading branch information
1 parent
b5135b3
commit aaf4ab2
Showing
3 changed files
with
51 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters