ack/util/ego/cs
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
..
cs.c Solve some gcc warnings in ego. 2018-03-08 18:51:07 -05:00
cs.h Optimize procedures that do both a / b and a % b. 2018-03-05 13:32:06 -05:00
cs_alloc.c Use size_t and void with memory allocation in ego. 2017-11-14 20:35:18 -05:00
cs_alloc.h Fix my typo from commit 5bbbaf4. 2017-11-17 15:46:24 -05:00
cs_aux.c Use prototypes in ego/cs, ego/sp. 2018-02-05 16:09:30 -05:00
cs_aux.h Use prototypes in ego/cs, ego/sp. 2018-02-05 16:09:30 -05:00
cs_avail.c Optimize procedures that do both a / b and a % b. 2018-03-05 13:32:06 -05:00
cs_avail.h Use prototypes in ego/cs, ego/sp. 2018-02-05 16:09:30 -05:00
cs_debug.c Solve some gcc warnings in ego. 2018-03-08 18:51:07 -05:00
cs_debug.h Use prototypes in ego/cs, ego/sp. 2018-02-05 16:09:30 -05:00
cs_elim.c Check LOI expressions to prevent a read after free. 2018-03-12 20:58:31 -04:00
cs_elim.h Use prototypes in ego/cs, ego/sp. 2018-02-05 16:09:30 -05:00
cs_entity.c Use prototypes in ego/cs, ego/sp. 2018-02-05 16:09:30 -05:00
cs_entity.h Use prototypes in ego/cs, ego/sp. 2018-02-05 16:09:30 -05:00
cs_getent.c Use prototypes in ego/cs, ego/sp. 2018-02-05 16:09:30 -05:00
cs_getent.h Use prototypes in ego/cs, ego/sp. 2018-02-05 16:09:30 -05:00
cs_kill.c Use prototypes in ego/cs, ego/sp. 2018-02-05 16:09:30 -05:00
cs_kill.h Use prototypes in ego/cs, ego/sp. 2018-02-05 16:09:30 -05:00
cs_partit.c Optimize procedures that do both a / b and a % b. 2018-03-05 13:32:06 -05:00
cs_partit.h Use prototypes in ego/cs, ego/sp. 2018-02-05 16:09:30 -05:00
cs_profit.c Solve some gcc warnings in ego. 2018-03-08 18:51:07 -05:00
cs_profit.h Optimize procedures that do both a / b and a % b. 2018-03-05 13:32:06 -05:00
cs_stack.c Use prototypes in ego/cs, ego/sp. 2018-02-05 16:09:30 -05:00
cs_stack.h Use prototypes in ego/cs, ego/sp. 2018-02-05 16:09:30 -05:00
cs_vnm.c Optimize procedures that do both a / b and a % b. 2018-03-05 13:32:06 -05:00
cs_vnm.h Use prototypes in ego/cs, ego/sp. 2018-02-05 16:09:30 -05:00