zenith391 / OCEmu

OpenComputers Emulator in Lua

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

sanitize logs

Ocawesome101 opened this issue · comments

In an attempt to debug the previous three issues I opened, I turned on OCEmu's debug option. Come to find out, it evidently doesn't sanitize its log output, meaning I can send VT100 escapes through it and they take effect, and because ULOS uses \27[8m in a few places, log output is completely hidden after the first occurrence of this.

Not a particularly critical bug (and could actually enable some interesting functionality) but would be nice to have fixed. A simple message:gsub("[\0-\30]", function(c) return string.format("\\%d", c:byte()) end) somewhere in the logging code would probably suffice.