coreboot-kgpe-d16/util/romcc/tests
Jacob Garber ae8301fddb util/romcc: Fix parsing of empty string literal
The corner case of an empty string literal was causing romcc to
segfault. This checks if the literal is empty, and if so allocates a
size one buffer for the terminating null character. A test case for
this is added to ensure it doesn't happen again.

Found-by: Coverity CID 1129099
Signed-off-by: Jacob Garber <jgarber1@ualberta.ca>
Change-Id: I067160a3b9998184f44e4878ef6269f372fe68bb
Reviewed-on: https://review.coreboot.org/c/coreboot/+/32852
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2019-05-21 09:28:36 +00:00
..
include Since some people disapprove of white space cleanups mixed in regular commits 2010-04-27 06:56:47 +00:00
fail_test1.c - Commit more tests for romcc 2003-07-12 01:40:54 +00:00
fail_test2.c Since some people disapprove of white space cleanups mixed in regular commits 2010-04-27 06:56:47 +00:00
fail_test3.c - Moved 2 of the test cases into tests for failure 2003-07-04 15:14:04 +00:00
fail_test4.c - O2, enums, and switch statements work in romcc 2003-10-11 06:20:25 +00:00
fail_test5.c - O2, enums, and switch statements work in romcc 2003-10-11 06:20:25 +00:00
fail_test6.c - Moved hlt() to it's own header. 2004-03-11 15:01:31 +00:00
fail_test7.c - Moved hlt() to it's own header. 2004-03-11 15:01:31 +00:00
fail_test8.c - Moved hlt() to it's own header. 2004-03-11 15:01:31 +00:00
fail_test9.c Remove empty lines at end of file 2015-06-08 00:55:07 +02:00
fail_test10.c Remove empty lines at end of file 2015-06-08 00:55:07 +02:00
fail_test11.c Remove empty lines at end of file 2015-06-08 00:55:07 +02:00
hello_world.c Since some people disapprove of white space cleanups mixed in regular commits 2010-04-27 06:56:47 +00:00
hello_world1.c Since some people disapprove of white space cleanups mixed in regular commits 2010-04-27 06:56:47 +00:00
hello_world2.c Since some people disapprove of white space cleanups mixed in regular commits 2010-04-27 06:56:47 +00:00
ldscript.ld romcc: Increase base address in linux ld script 2016-04-13 17:36:39 +02:00
linux_console.h Since some people disapprove of white space cleanups mixed in regular commits 2010-04-27 06:56:47 +00:00
linux_syscall.h - O2, enums, and switch statements work in romcc 2003-10-11 06:20:25 +00:00
linux_test1.c romcc: Use UNIX line endings in linux tests 2016-04-13 17:37:03 +02:00
linux_test2.c util/romcc: Fix typos 2018-08-28 14:22:24 +00:00
linux_test3.c Since some people disapprove of white space cleanups mixed in regular commits 2010-04-27 06:56:47 +00:00
linux_test4.c Since some people disapprove of white space cleanups mixed in regular commits 2010-04-27 06:56:47 +00:00
linux_test5.c util: Fix typo on plural form of index 2019-05-20 14:45:35 +00:00
linux_test6.c romcc: Use UNIX line endings in linux tests 2016-04-13 17:37:03 +02:00
linux_test7.c - O2, enums, and switch statements work in romcc 2003-10-11 06:20:25 +00:00
linux_test8.c romcc: Use UNIX line endings in linux tests 2016-04-13 17:37:03 +02:00
linux_test9.c - Upgrade to romcc version 0.63 2004-05-28 14:11:54 +00:00
linux_test10.c - Upgrade to romcc version 0.63 2004-05-28 14:11:54 +00:00
linux_test11.c - Upgrade to romcc version 0.63 2004-05-28 14:11:54 +00:00
linux_test12.c - Upgrade to romcc version 0.63 2004-05-28 14:11:54 +00:00
linux_test13.c Since some people disapprove of white space cleanups mixed in regular commits 2010-04-27 06:56:47 +00:00
linuxi386_syscall.h Since some people disapprove of white space cleanups mixed in regular commits 2010-04-27 06:56:47 +00:00
raminit_test.c util/romcc: Fix typos 2018-08-28 14:22:24 +00:00
raminit_test1.c util/romcc: Fix typos 2018-08-28 14:22:24 +00:00
raminit_test2.c util/romcc: Fix typos 2018-08-28 14:22:24 +00:00
raminit_test3.c - Update romcc to version 0.27 and add more tests. 2003-06-10 21:22:07 +00:00
raminit_test4.c - Reduce the algorithmic complexity of parts of the register allocator 2003-06-16 16:57:34 +00:00
raminit_test5.c - Massive set of cleanups/fixes for romcc. Lots of corner cases now work 2003-07-01 10:05:30 +00:00
raminit_test6.c util: Fix typo on plural form of index 2019-05-20 14:45:35 +00:00
raminit_test7.c util: Fix typo on plural form of index 2019-05-20 14:45:35 +00:00
simple_test.c Since some people disapprove of white space cleanups mixed in regular commits 2010-04-27 06:56:47 +00:00
simple_test1.c Since some people disapprove of white space cleanups mixed in regular commits 2010-04-27 06:56:47 +00:00
simple_test2.c Since some people disapprove of white space cleanups mixed in regular commits 2010-04-27 06:56:47 +00:00
simple_test3.c Since some people disapprove of white space cleanups mixed in regular commits 2010-04-27 06:56:47 +00:00
simple_test4.c smbus: Fix a typo ("Set the device I'm talking too") 2017-09-27 16:38:18 +00:00
simple_test5.c smbus: Fix a typo ("Set the device I'm talking too") 2017-09-27 16:38:18 +00:00
simple_test6.c smbus: Fix a typo ("Set the device I'm talking too") 2017-09-27 16:38:18 +00:00
simple_test7.c Since some people disapprove of white space cleanups mixed in regular commits 2010-04-27 06:56:47 +00:00
simple_test8.c - Checking latest version of romcc 2003-04-22 18:44:01 +00:00
simple_test9.c - Checking latest version of romcc 2003-04-22 18:44:01 +00:00
simple_test10.c Remove empty lines at end of file 2015-06-08 00:55:07 +02:00
simple_test11.c - Checking latest version of romcc 2003-04-22 18:44:01 +00:00
simple_test12.c Remove empty lines at end of file 2015-06-08 00:55:07 +02:00
simple_test13.c - Checking latest version of romcc 2003-04-22 18:44:01 +00:00
simple_test14.c - Checking latest version of romcc 2003-04-22 18:44:01 +00:00
simple_test15.c - Checking latest version of romcc 2003-04-22 18:44:01 +00:00
simple_test16.c - Update the test cases for romcc 2003-05-08 00:31:34 +00:00
simple_test17.c Remove empty lines at end of file 2015-06-08 00:55:07 +02:00
simple_test18.c - Update the test cases for romcc 2003-05-08 00:31:34 +00:00
simple_test19.c Since some people disapprove of white space cleanups mixed in regular commits 2010-04-27 06:56:47 +00:00
simple_test20.c Since some people disapprove of white space cleanups mixed in regular commits 2010-04-27 06:56:47 +00:00
simple_test21.c - Update romcc to version 0.27 and add more tests. 2003-06-10 21:22:07 +00:00
simple_test22.c Since some people disapprove of white space cleanups mixed in regular commits 2010-04-27 06:56:47 +00:00
simple_test23.c - Update romcc to version 0.27 and add more tests. 2003-06-10 21:22:07 +00:00
simple_test24.c - Update romcc to version 0.27 and add more tests. 2003-06-10 21:22:07 +00:00
simple_test25.c - Update romcc to version 0.27 and add more tests. 2003-06-10 21:22:07 +00:00
simple_test26.c - Update romcc to version 0.27 and add more tests. 2003-06-10 21:22:07 +00:00
simple_test27.c Since some people disapprove of white space cleanups mixed in regular commits 2010-04-27 06:56:47 +00:00
simple_test28.c - Update romcc to version 0.27 and add more tests. 2003-06-10 21:22:07 +00:00
simple_test29.c - Update romcc to version 0.27 and add more tests. 2003-06-10 21:22:07 +00:00
simple_test30.c util/romcc: Fix typos 2018-08-28 14:22:24 +00:00
simple_test31.c - Factoring of auto.c 2003-06-11 21:55:00 +00:00
simple_test32.c Since some people disapprove of white space cleanups mixed in regular commits 2010-04-27 06:56:47 +00:00
simple_test33.c Remove empty lines at end of file 2015-06-08 00:55:07 +02:00
simple_test34.c - Update the romcc version. 2003-06-19 15:14:52 +00:00
simple_test35.c - Update the romcc version. 2003-06-19 15:14:52 +00:00
simple_test36.c Since some people disapprove of white space cleanups mixed in regular commits 2010-04-27 06:56:47 +00:00
simple_test37.c Since some people disapprove of white space cleanups mixed in regular commits 2010-04-27 06:56:47 +00:00
simple_test38.c Since some people disapprove of white space cleanups mixed in regular commits 2010-04-27 06:56:47 +00:00
simple_test39.c Since some people disapprove of white space cleanups mixed in regular commits 2010-04-27 06:56:47 +00:00
simple_test40.c - Commit more tests for romcc 2003-07-12 01:40:54 +00:00
simple_test41.c - Update romcc so that it more successfully spills registers to the xmm registers 2003-06-28 06:49:45 +00:00
simple_test43.c Since some people disapprove of white space cleanups mixed in regular commits 2010-04-27 06:56:47 +00:00
simple_test45.c Since some people disapprove of white space cleanups mixed in regular commits 2010-04-27 06:56:47 +00:00
simple_test46.c util: Fix typo on plural form of index 2019-05-20 14:45:35 +00:00
simple_test47.c Remove empty lines at end of file 2015-06-08 00:55:07 +02:00
simple_test48.c Since some people disapprove of white space cleanups mixed in regular commits 2010-04-27 06:56:47 +00:00
simple_test49.c Since some people disapprove of white space cleanups mixed in regular commits 2010-04-27 06:56:47 +00:00
simple_test50.c Since some people disapprove of white space cleanups mixed in regular commits 2010-04-27 06:56:47 +00:00
simple_test51.c - Massive set of cleanups/fixes for romcc. Lots of corner cases now work 2003-07-01 10:05:30 +00:00
simple_test52.c - Massive set of cleanups/fixes for romcc. Lots of corner cases now work 2003-07-01 10:05:30 +00:00
simple_test53.c - Massive set of cleanups/fixes for romcc. Lots of corner cases now work 2003-07-01 10:05:30 +00:00
simple_test54.c util: Fix typo on plural form of index 2019-05-20 14:45:35 +00:00
simple_test55.c - Moved 2 of the test cases into tests for failure 2003-07-04 15:14:04 +00:00
simple_test56.c Since some people disapprove of white space cleanups mixed in regular commits 2010-04-27 06:56:47 +00:00
simple_test57.c - O2, enums, and switch statements work in romcc 2003-10-11 06:20:25 +00:00
simple_test58.c - O2, enums, and switch statements work in romcc 2003-10-11 06:20:25 +00:00
simple_test59.c Since some people disapprove of white space cleanups mixed in regular commits 2010-04-27 06:56:47 +00:00
simple_test60.c - Upgrade to romcc version 0.63 2004-05-28 14:11:54 +00:00
simple_test61.c smbus: Fix a typo ("Set the device I'm talking too") 2017-09-27 16:38:18 +00:00
simple_test62.c - O2, enums, and switch statements work in romcc 2003-10-11 06:20:25 +00:00
simple_test63.c - O2, enums, and switch statements work in romcc 2003-10-11 06:20:25 +00:00
simple_test64.c - O2, enums, and switch statements work in romcc 2003-10-11 06:20:25 +00:00
simple_test65.c Since some people disapprove of white space cleanups mixed in regular commits 2010-04-27 06:56:47 +00:00
simple_test66.c Since some people disapprove of white space cleanups mixed in regular commits 2010-04-27 06:56:47 +00:00
simple_test67.c Since some people disapprove of white space cleanups mixed in regular commits 2010-04-27 06:56:47 +00:00
simple_test68.c - O2, enums, and switch statements work in romcc 2003-10-11 06:20:25 +00:00
simple_test69.c - Update romcc to version 0.37 2003-10-22 04:03:46 +00:00
simple_test70.c - Update romcc to version 0.37 2003-10-22 04:03:46 +00:00
simple_test71.c - Upgrade to romcc version 0.63 2004-05-28 14:11:54 +00:00
simple_test72.c Remove empty lines at end of file 2015-06-08 00:55:07 +02:00
simple_test73.c Since some people disapprove of white space cleanups mixed in regular commits 2010-04-27 06:56:47 +00:00
simple_test74.c Since some people disapprove of white space cleanups mixed in regular commits 2010-04-27 06:56:47 +00:00
simple_test75.c Since some people disapprove of white space cleanups mixed in regular commits 2010-04-27 06:56:47 +00:00
simple_test76.c Since some people disapprove of white space cleanups mixed in regular commits 2010-04-27 06:56:47 +00:00
simple_test77.c - Upgrade to romcc version 0.63 2004-05-28 14:11:54 +00:00
simple_test78.c - Upgrade to romcc version 0.63 2004-05-28 14:11:54 +00:00
simple_test79.c - Upgrade to romcc version 0.63 2004-05-28 14:11:54 +00:00
simple_test80.c Remove empty lines at end of file 2015-06-08 00:55:07 +02:00
simple_test81.c Since some people disapprove of white space cleanups mixed in regular commits 2010-04-27 06:56:47 +00:00
simple_test82.c Remove empty lines at end of file 2015-06-08 00:55:07 +02:00
simple_test83.c - Upgrade to romcc version 0.63 2004-05-28 14:11:54 +00:00
simple_test84.c - Upgrade to romcc version 0.63 2004-05-28 14:11:54 +00:00
simple_test85.c - Upgrade to romcc version 0.63 2004-05-28 14:11:54 +00:00
simple_test86.c - Upgrade to romcc version 0.63 2004-05-28 14:11:54 +00:00
simple_test87.c util/romcc: Fix parsing of empty string literal 2019-05-21 09:28:36 +00:00