(uxnasm) Fixed buffer overflow in tokenizer
This commit is contained in:
parent
4e68dc7753
commit
a1bc00ce5f
2
build.sh
2
build.sh
|
@ -115,7 +115,7 @@ echo "Assembling(asma).."
|
|||
if [ $norun = 1 ]; then exit; fi
|
||||
|
||||
echo "Assembling(piano).."
|
||||
./bin/uxnasm projects/software/piano.tal bin/piano.rom 2> bin/piano.log
|
||||
./bin/uxnasm projects/software/piano.tal bin/piano.rom
|
||||
|
||||
echo "Running.."
|
||||
./bin/uxnemu bin/piano.rom
|
||||
|
|
|
@ -32,8 +32,8 @@ WITH REGARD TO THIS SOFTWARE.
|
|||
int
|
||||
uxn_eval(Uxn *u, Uint16 pc)
|
||||
{
|
||||
Uint16 a, b, c, j, k, bs, instr;
|
||||
Uint8 kptr, *sp;
|
||||
Uint16 a, b, c, j, k, bs, instr;
|
||||
Stack *src, *dst;
|
||||
if(!pc || u->dev[0x0f]) return 0;
|
||||
while((instr = u->ram[pc++])) {
|
||||
|
|
|
@ -416,9 +416,9 @@ assemble(FILE *f)
|
|||
{
|
||||
char w[0x40];
|
||||
scpy("on-reset", p.scope, 0x40);
|
||||
while(fscanf(f, "%63s", w) == 1)
|
||||
if(!parse(w, f))
|
||||
return error("Unknown token", w);
|
||||
while(fscanf(f, "%62s", w) == 1)
|
||||
if(slen(w) > 0x3d || !parse(w, f))
|
||||
return error("Invalid token", w);
|
||||
return resolve();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue