Alex Richardson 81c3f64110 usr.bin/grep: Fix Address OOB read error
I found this when compiling all the bootstrap tools with -fsanitize=addres:

==65590==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x62d000008400 at pc 0x000000473053 bp 0x7ffc1c7dd910 sp 0x7ffc1c7dd0b8
READ of size 32769 at 0x62d000008400 thread T0
    #0 0x473052 in regexec (/local/scratch/alr48/cheri/build/freebsd-amd64-build/local/scratch/alr48/cheri/freebsd/amd64.amd64/tmp/legacy/bin/grep+0x473052)
    #1 0x4c9cf3 in procline /local/scratch/alr48/cheri/freebsd/usr.bin/grep/util.c:539:8
    #2 0x4c8687 in procfile /local/scratch/alr48/cheri/freebsd/usr.bin/grep/util.c:379:18
    #3 0x4c6596 in main /local/scratch/alr48/cheri/freebsd/usr.bin/grep/grep.c:714:8

0x62d000008400 is located 0 bytes to the right of 32768-byte region [0x62d000000400,0x62d000008400)
allocated by thread T0 here:
    #0 0x493d5d in malloc (/local/scratch/alr48/cheri/build/freebsd-amd64-build/local/scratch/alr48/cheri/freebsd/amd64.amd64/tmp/legacy/bin/grep+0x493d5d)
    #1 0x4cad75 in grep_malloc /local/scratch/alr48/cheri/freebsd/usr.bin/grep/util.c:656:13
    #2 0x4c8129 in procfile /local/scratch/alr48/cheri/freebsd/usr.bin/grep/util.c
    #3 0x4c6596 in main /local/scratch/alr48/cheri/freebsd/usr.bin/grep/grep.c:714:8

SUMMARY: AddressSanitizer: heap-buffer-overflow (/local/scratch/alr48/cheri/build/freebsd-amd64-build/local/scratch/alr48/cheri/freebsd/amd64.amd64/tmp/legacy/bin/grep+0x473052) in regexec

Reviewed By:	kevans
MFC after:	1 week
2021-02-09 17:13:32 +00:00
..
2017-10-31 00:07:04 +00:00
2020-06-13 09:16:07 +00:00
2020-10-27 09:41:01 +00:00
2019-01-12 12:35:02 +00:00
2021-01-13 22:21:37 -08:00
2019-12-11 17:37:53 +00:00
2020-11-16 18:41:49 +00:00
2020-10-09 14:03:45 +00:00
2019-12-11 17:37:53 +00:00
2020-10-21 16:30:34 +00:00
2020-06-23 10:27:41 +00:00
2020-07-27 16:51:23 +00:00
2020-10-10 13:01:04 +00:00
2020-10-09 19:12:44 +00:00
2021-01-07 09:31:03 +00:00
2017-10-31 00:07:04 +00:00
2021-01-23 17:24:32 +02:00
2018-04-25 18:56:27 +00:00
2020-10-30 09:48:41 +00:00
2017-10-31 00:07:04 +00:00
2020-10-29 18:37:20 +00:00
2020-10-29 18:39:04 +00:00
2020-11-19 19:05:16 +00:00
2017-10-31 00:07:04 +00:00
2020-10-24 16:40:34 +00:00
2020-12-26 11:47:47 -05:00
2019-12-11 17:37:53 +00:00
2020-06-29 15:15:14 +00:00
2017-10-31 00:07:04 +00:00
2020-11-29 18:22:14 +00:00
2020-12-10 18:34:15 +00:00
2020-12-19 12:54:00 +00:00
2020-10-09 19:12:44 +00:00
2018-03-02 23:31:55 +00:00
2020-06-20 11:27:59 +00:00
2021-01-07 09:31:03 +00:00
2021-01-09 18:37:25 +01:00
2021-01-29 10:53:50 -08:00
2019-11-12 22:31:59 +00:00
2019-06-29 18:41:40 +00:00
2020-06-18 18:09:16 +00:00
2020-06-25 16:46:27 +00:00
2020-12-11 08:04:54 +00:00
2020-12-11 19:27:21 +00:00
2020-12-29 21:48:12 +01:00
2020-12-29 21:35:24 +01:00
2020-09-11 13:28:37 +00:00
2021-01-09 18:22:08 +01:00
2018-01-06 15:52:28 +00:00
2020-10-24 05:52:29 +00:00
2020-06-18 08:26:26 +00:00
2019-12-11 17:37:53 +00:00
2021-01-29 23:52:13 -06:00
2018-11-20 00:06:53 +00:00
2020-07-01 16:33:32 +00:00
2020-06-27 11:19:18 +00:00
2018-07-03 19:09:46 +00:00
2018-06-25 11:44:56 +00:00
2021-01-05 16:32:27 +01:00
2020-06-20 11:24:29 +00:00
2020-10-09 14:03:45 +00:00
2019-12-11 17:37:53 +00:00
2020-12-30 13:45:53 -05:00
2020-06-18 15:14:10 +00:00
2019-05-01 19:35:45 +00:00
2019-12-11 17:37:53 +00:00
2020-03-26 17:58:52 +00:00
2017-12-28 05:33:39 +00:00
2020-06-23 10:22:58 +00:00
2019-12-11 17:37:53 +00:00
2020-10-09 14:03:45 +00:00
2020-07-07 16:07:39 +00:00
2020-07-07 17:02:23 +00:00
2020-07-14 22:43:40 +00:00
2021-02-05 11:28:29 -05:00
2020-08-30 17:37:56 +00:00
2019-11-20 19:43:34 +00:00
2017-10-31 00:07:04 +00:00
2021-01-02 10:50:08 +09:00
2020-09-11 13:28:37 +00:00
2018-11-12 07:14:34 +00:00
2020-10-01 04:46:23 +00:00
2017-10-31 00:07:04 +00:00
2020-08-24 17:57:08 +00:00
2020-08-30 17:40:59 +00:00
2020-12-12 15:38:32 +00:00
2020-01-25 21:16:45 +00:00
2017-10-31 00:07:04 +00:00
2017-10-31 00:07:04 +00:00
2020-07-14 01:54:24 +00:00
2020-09-11 13:28:37 +00:00