snprintf with len=256 into buffer with len=80
ATasm is a 6502 command-line cross-assembler.
Brought to you by:
schmelze
There is a bug which comes out when atasm is compiled with buffer overflow checking. In function get_expression() from setparse.c there is a snprintf call with max length = 256 into a buffer with length of 80 chars.
The result of running atasm:
./atasm ../tests/testraw.m65
ATasm 1.05 beta (A mostly Mac65 compatible 6502 cross-assembler)
Pass 1: *** buffer overflow detected ***: ./atasm terminated
======= Backtrace: =========
...
A fix is attached.
PS: This is a result of a package preparation for Fedora Linux.
patch to solve buffer overflow in setparse.c
Fixed in r63, version 1.06