From 91db7358484f885eefe822d42cfe15101b2b417c Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Tue, 9 Dec 2014 13:55:54 +0100 Subject: mds-kbdc: compile-layout: watch out for incomplete function calls MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/mds-kbdc/compile-layout.c | 6 ++++++ test-files/mds-kbdc/compile-layout/invalid/incomplete_function_call | 3 +++ 2 files changed, 9 insertions(+) create mode 100644 test-files/mds-kbdc/compile-layout/invalid/incomplete_function_call diff --git a/src/mds-kbdc/compile-layout.c b/src/mds-kbdc/compile-layout.c index 1e537d5..1d05d83 100644 --- a/src/mds-kbdc/compile-layout.c +++ b/src/mds-kbdc/compile-layout.c @@ -445,6 +445,12 @@ static char32_t* parse_function_call(mds_kbdc_tree_t* restrict tree, const char* arguments_ptr++; break; } + else if (**end == '\0') + { + if (tree->processed != PROCESS_LEVEL) + NEW_ERROR(tree, ERROR, "incomplete function call"); + goto error; + } r = parse_function_argument(tree, *end, lineoff + (size_t)(*end - raw), end, arguments + arguments_ptr++); fail_if (r < 0); } diff --git a/test-files/mds-kbdc/compile-layout/invalid/incomplete_function_call b/test-files/mds-kbdc/compile-layout/invalid/incomplete_function_call new file mode 100644 index 0000000..a1e76a6 --- /dev/null +++ b/test-files/mds-kbdc/compile-layout/invalid/incomplete_function_call @@ -0,0 +1,3 @@ +\f( +"" : <\f( + -- cgit v1.2.3-70-g09d2