Commit Graph

3 Commits

Author SHA1 Message Date
gizak
196d9aae34 Theme map lookup 2015-09-21 03:11:58 -04:00
gizak
e89b10ff4f Finish Event 2015-09-18 11:41:44 -04:00
Matteo Kloiber
821f8bfd95 Fixes unsafe pointer madness.
`func uiEvt(e termbox.Event) Event` used to change the type of termbox.Event to Event by
using some pointer-cast magic[1], which could cause an overflow if `termbox.Event` changes
its structure.
I'd rather just have `type Event termbox.Event` but that would break backwards compatibility.

Warning: A buffer overflow could cause a serious security issue but it is very unlikely that
anyone could exploit that (though not impossbible). You'd need to push a upstream update to
termbox, which would tweak termbox.Event's structure. Still, this issue should be fixed and
unsafe should never be used.

[1] it used to get the address of termbox.Event and just cast a Event pointer
2015-04-15 13:49:31 +02:00