From: John Darrington Date: Thu, 31 Mar 2016 06:22:44 +0000 (+0200) Subject: Fixed a bug where INSERT would crash when an unterminated string was given. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=50316ca3fc789021c60642000764a3ec0e667850;p=pspp Fixed a bug where INSERT would crash when an unterminated string was given. Found by zzuf. --- diff --git a/src/language/utilities/include.c b/src/language/utilities/include.c index 2c0f3ae8cc..473f675130 100644 --- a/src/language/utilities/include.c +++ b/src/language/utilities/include.c @@ -62,6 +62,9 @@ do_insert (struct lexer *lexer, struct dataset *ds, enum variant variant) return CMD_FAILURE; relative_name = utf8_to_filename (lex_tokcstr (lexer)); + if (NULL == relative_name) + return CMD_FAILURE; + filename = include_path_search (relative_name); free (relative_name); diff --git a/tests/language/utilities/insert.at b/tests/language/utilities/insert.at index e8e76502da..8ae9f3eb51 100644 --- a/tests/language/utilities/insert.at +++ b/tests/language/utilities/insert.at @@ -181,3 +181,16 @@ ONE Äpfelfölfaß ]) AT_CLEANUP + + + + +dnl Test for a bug where insert crashed on an unterminated string input +AT_SETUP([INSERT unterminated string]) + +AT_DATA([insert.sps], [INSERT FILE=7bar.sps' CD=NO. +]) + +AT_CHECK([pspp -O format=csv insert.sps], [1], [ignore]) + +AT_CLEANUP