Fix several cases where lex_integer() or lex_number() could assert-fail.
[pspp] / src / language / stats / npar.c
index 5d8d8742f9c51935a32966c17b7722e3acb59344..d89eb0b876d63889f9a796b81b2a34f8daac3e29 100644 (file)
@@ -1,5 +1,5 @@
 /* PSPP - a program for statistical analysis. -*-c-*-
-   Copyright (C) 2006, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+   Copyright (C) 2006, 2008, 2009, 2010, 2011, 2016 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -865,6 +865,8 @@ npar_chisquare (struct lexer *lexer, struct dataset *ds,
               if ( lex_match (lexer, T_ASTERISK))
                 {
                   n = f;
+                  if (!lex_force_num (lexer))
+                    return 0;
                   f = lex_number (lexer);
                   lex_get (lexer);
                 }