ack/util/ego
George Koehler 85fcbde22f Check LOI expressions to prevent a read after free.
CS eliminates outer expressions before inner ones, as `x * y * z`
before `x * y`.  It does this by reversing the order of expressions in
the code.  This almost always works, but it sometimes doesn't work if
a STI changes the value number of a LOI.  In code like `expr1 LOI
expr2 STI expr2 LOI`, CS might eliminate the inner `expr2` before the
outer `expr2 LOI`.  This caused a read after free because the
occurrence of `expr2 LOI` pointed to the eliminated lines of `expr2`.

This bug went unnoticed until my recent changes caused CS to crash
with a double free.  I did not get the crash in OpenBSD, but I saw the
crash in Travis, then David Given reproduced the crash in Linux.  See
the discussion in https://github.com/davidgiven/ack/pull/73
2018-03-12 20:58:31 -04:00
..
bo Add prototypes, void in util/ego/share 2017-11-15 17:19:56 -05:00
ca Don't read INSTR(l) after oldline(l) frees it. 2018-03-11 20:10:13 -04:00
cf Add enough return types to the K&R C that the ACK builds (on Linux) using clang 2016-11-10 22:04:18 +01:00
cj Add prototypes, void in util/ego/share 2017-11-15 17:19:56 -05:00
cs Check LOI expressions to prevent a read after free. 2018-03-12 20:58:31 -04:00
descr Optimize procedures that do both a / b and a % b. 2018-03-05 13:32:06 -05:00
em_ego Don't use '-' in option string to getopt(). 2017-10-29 23:25:07 -04:00
ic Fix a whole lot more stray prototypes. 2016-11-24 21:47:40 +01:00
il Add prototypes, void in util/ego/share 2017-11-15 17:19:56 -05:00
lv Add prototypes, void in util/ego/share 2017-11-15 17:19:56 -05:00
ra Add prototypes, void in util/ego/share 2017-11-15 17:19:56 -05:00
share Solve some gcc warnings in ego. 2018-03-08 18:51:07 -05:00
sp Use prototypes in ego/cs, ego/sp. 2018-02-05 16:09:30 -05:00
sr Add prototypes, void in util/ego/share 2017-11-15 17:19:56 -05:00
ud Fixes for compiling ego with -DTRACE 2018-03-01 13:19:38 -05:00
Action Initial revision 1987-01-13 11:31:24 +00:00
build.lua Fixes for compiling ego with -DTRACE 2018-03-01 13:19:38 -05:00