Assaf Gordon
c52a676e5e
sed: fix heap buffer overflow from invalid references
...
Under certain conditions sed would access invalid memory based on
the requested back-reference (e.g. "s//\9/" would access the 9th element
in the regex registers without checking it is at least 9 element in
size).
The following examples would trigger valgrind errors:
seq 2 | valgrind sed -e '/^/s///p ; 2s//\9/'
seq 2 | valgrind sed --posix -e '/2/p ; 2s//\9/'
Reported by bugs@feusi.co in
https://lists.gnu.org/r/bug-sed/2018-07/msg00004.html .
* NEWS: Mention the bugfix.
* sed/execute.c (append_replacement): Check number of allocated regex
replacement registers before accessing the array.
* sed/testsuite/bug32082.sh: Test sed for this behaviour under valgrind.
* sed/testsuite/local.mk (T): Add new test.
2018-07-08 20:09:51 -06:00
..
2004-10-20 21:42:31 +00:00
2004-10-20 21:42:31 +00:00
2018-02-13 16:02:12 -07:00
2018-02-13 16:02:12 -07:00
2018-02-13 16:02:12 -07:00
2014-11-30 18:59:32 -08:00
2014-11-30 18:59:32 -08:00
2014-11-30 18:59:32 -08:00
2018-02-13 16:02:12 -07:00
2017-05-10 21:39:57 -04:00
2018-02-13 16:02:12 -07:00
2008-04-24 16:22:56 +02:00
2008-04-24 16:22:56 +02:00
2018-07-08 20:09:51 -06:00
2018-02-13 16:02:12 -07:00
2018-02-13 16:02:12 -07:00
2018-02-13 16:02:12 -07:00
2018-02-13 16:02:12 -07:00
2018-02-13 16:02:12 -07:00
2018-02-13 16:02:12 -07:00
2018-02-13 16:02:12 -07:00
2018-02-13 16:02:12 -07:00
2018-02-13 16:02:12 -07:00
2018-02-13 16:02:12 -07:00
2018-02-13 16:02:12 -07:00
2004-10-20 21:42:31 +00:00
2018-02-13 16:02:12 -07:00
2004-10-20 21:42:31 +00:00
2018-02-13 16:02:12 -07:00
2018-02-13 16:02:12 -07:00
2018-02-13 16:02:12 -07:00
2018-02-13 16:02:12 -07:00
2018-02-13 16:02:12 -07:00
2018-02-13 16:02:12 -07:00
2018-01-02 13:56:16 -07:00
2018-02-13 16:02:12 -07:00
2018-02-13 16:02:12 -07:00
2018-02-13 16:02:12 -07:00
2018-02-13 16:02:12 -07:00
2018-03-22 16:00:43 -07:00
2018-02-13 16:02:12 -07:00
2018-03-30 21:33:01 -07:00
2018-02-13 16:02:12 -07:00
2018-07-08 20:09:51 -06:00
2014-11-30 18:59:32 -08:00
2014-11-30 18:59:32 -08:00
2014-11-30 18:59:32 -08:00
2018-02-13 16:02:12 -07:00
2004-10-20 21:42:31 +00:00
2004-10-20 21:42:31 +00:00
2004-10-20 21:42:31 +00:00
2018-02-13 16:02:12 -07:00
2018-02-13 16:02:12 -07:00
2018-02-13 16:02:12 -07:00
2018-02-13 16:02:12 -07:00
2018-02-13 16:02:12 -07:00
2018-03-14 18:41:09 -04:00
2018-02-13 16:02:12 -07:00
2018-02-13 16:02:12 -07:00
2018-02-13 16:02:12 -07:00
2018-02-13 16:02:12 -07:00
2018-02-13 16:02:12 -07:00
2014-11-30 18:59:32 -08:00
2018-02-13 16:02:12 -07:00
2018-02-13 16:02:12 -07:00
2018-02-13 16:02:12 -07:00
2018-02-13 16:02:12 -07:00
2018-02-13 16:02:12 -07:00
2018-02-13 16:02:12 -07:00
2004-10-20 21:42:31 +00:00
2018-02-13 16:02:12 -07:00
2018-02-13 16:02:12 -07:00
2018-02-13 16:02:12 -07:00
2018-03-23 08:58:01 -06:00
2018-02-13 16:02:12 -07:00
2009-01-09 11:17:17 +01:00
2018-02-13 16:02:12 -07:00
2018-02-13 16:02:12 -07:00
2018-02-13 16:02:12 -07:00
2018-02-13 16:02:12 -07:00
2018-02-13 16:02:12 -07:00
2018-02-13 16:02:12 -07:00
2018-01-02 13:56:16 -07:00
2004-10-20 21:42:31 +00:00
2018-02-13 16:02:12 -07:00
2018-02-13 16:02:12 -07:00
2014-11-30 18:59:32 -08:00
2014-11-30 18:59:32 -08:00
2004-10-20 21:42:31 +00:00
2018-02-13 16:02:12 -07:00
2018-02-13 16:02:12 -07:00
2018-01-02 13:56:16 -07:00
2018-01-02 13:56:16 -07:00
2018-02-13 16:02:12 -07:00