pixel / hexedit

View and edit files in hexadecimal or in ASCII
http://rigaux.org/hexedit.html
GNU General Public License v2.0
98 stars 41 forks source link

Do not allow negative line length. #34

Closed stoeckmann closed 5 years ago

stoeckmann commented 5 years ago

Supplying a negative line length results in illegal memory access while parsing the input file (the memset that is supposed to clear the memory triggers an out of boundary write).

While at it, also prevent line length to become too large. It is used in a multiplication with LINES during page calculation. If in doubt, you can increase that limit of course.

Signed-off-by: Tobias Stoeckmann tobias@stoeckmann.org

stoeckmann commented 5 years ago

To reproduce: hexedit -l -1 /dev/null