X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tests%2Flanguage%2Flexer%2Flexer.at;h=25ced0d9ab199a4fd59a7935a419117aed9f4b3b;hb=ccd1837ed5df23149584f88f6cc907cda0faaea9;hp=08c146447fbed1964843a9544efec6f63b9292e2;hpb=fe8dc2171009e90d2335f159d05f7e6660e24780;p=pspp diff --git a/tests/language/lexer/lexer.at b/tests/language/lexer/lexer.at index 08c146447f..25ced0d9ab 100644 --- a/tests/language/lexer/lexer.at +++ b/tests/language/lexer/lexer.at @@ -1,3 +1,19 @@ +dnl PSPP - a program for statistical analysis. +dnl Copyright (C) 2017 Free Software Foundation, Inc. +dnl +dnl This program is free software: you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation, either version 3 of the License, or +dnl (at your option) any later version. +dnl +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +dnl GNU General Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License +dnl along with this program. If not, see . +dnl AT_BANNER([lexer]) AT_SETUP([lexer ignores initial @%:@! line]) @@ -61,3 +77,33 @@ lexer.sps:10.1: error: Syntax error at ``': Bad character ``' in input. lexer.sps:11.1: error: Syntax error at `�': Bad character U+FFFD in input. ]) AT_CLEANUP + +# Bug #47602. +AT_SETUP([lexer crash due to null byte]) +# Intentionally leave out the new-line and add a null byte: +printf "datA dist list notable file='input.txt'/a b c. +lis|.\0" > lexer.sps + +AT_CHECK([pspp -O format=csv lexer.sps], [1], [dnl +lexer.sps:1: error: Unknown command `datA dist'. + +lexer.sps:2: error: LIST: LIST is allowed only after the active dataset has been defined. + +lexer.sps:2.5: error: LIST: Syntax error at `.': Unexpected `.' in middle of command. + +lexer.sps:2.6: error: LIST: Syntax error at `...': Bad character U+0000 in input. +]) +AT_CLEANUP + + + + +# Bug #54684 +AT_SETUP([lexer crash due to overflow]) +printf "DATA LIST/5555555555555555." > lexer.sps + +AT_CHECK([pspp -O format=csv lexer.sps], [1], [dnl +"lexer.sps:1: error: DATA LIST: The record number specified, 5555555555555555, is at or before the previous record, 0. Data fields must be listed in order of increasing record number." +]) + +AT_CLEANUP