diff options
author | Adam Jackson <ajax@nwnk.net> | 2005-12-09 18:27:47 +0000 |
---|---|---|
committer | Adam Jackson <ajax@nwnk.net> | 2005-12-09 18:27:47 +0000 |
commit | cbb537c9276302f56c82c0dd010db400bd605f57 (patch) | |
tree | ea0642984ba2a51bb1cedd15ccd8041f30e0ae23 | |
parent | 34c35bcb3851909468c679c2014b6197c7be270e (diff) |
Bug #4380: Avoid dividing by zero in gccmakedepend (Vincent Le Ligeour)MODULAR_COPY
-rw-r--r-- | ifparser.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -65,6 +65,7 @@ #include <ctype.h> #include <stdlib.h> #include <string.h> +#include <limits.h> /**************************************************************************** Internal Macros and Utilities for Parser @@ -296,7 +297,10 @@ parse_product (IfParser *g, const char *cp, long *valp) case '/': DO (cp = parse_product (g, cp + 1, &rightval)); - *valp = (*valp / rightval); + if (rightval) + *valp = (*valp / rightval); + else + *valp = LONG_MAX; break; case '%': |