From a148b23a22709a45647fd07ce95db9147217a061 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Sun, 25 Oct 2020 18:45:11 -0700 Subject: 7101 - tile: remove quotes when evaluating strings This found several bugs due to me not checking for null strings. --- 108write.subx | 3 +++ 1 file changed, 3 insertions(+) (limited to '108write.subx') diff --git a/108write.subx b/108write.subx index 988e21db..84060c62 100644 --- a/108write.subx +++ b/108write.subx @@ -25,6 +25,9 @@ write: # f: fd or (addr stream byte), s: (addr array byte) # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp + # if (s == 0) return + 81 7/subop/compare 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 0/imm32 # compare *(ebp+12) + 74/jump-if-= $write:end/disp8 # if (f < 0x08000000) _write(f, s) and return # f can't be a user-mode address, so treat it as a kernel file descriptor 81 7/subop/compare 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 0x08000000/imm32 # compare *(ebp+8) 73/jump-if-addr>= $write:fake/disp8 -- cgit 1.4.1-2-gfad0