diff options
author | Guy Harris <guy@alum.mit.edu> | 2010-04-30 21:55:42 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2010-04-30 21:55:42 +0000 |
commit | 06a24aaa7e3fc282404a92fc6e6e547341f07ad8 (patch) | |
tree | ee76ca9ccbdb9deab8e399d821008183184987a2 /epan | |
parent | d57979b197fab4732634453d071515a978c6c463 (diff) |
Pick up other check from the almost-identical routine in
epan/dfilter/scanner.l.
(The common code should be in a utility routine.)
svn path=/trunk/; revision=32619
Diffstat (limited to 'epan')
-rw-r--r-- | epan/ftypes/ftype-integer.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/epan/ftypes/ftype-integer.c b/epan/ftypes/ftype-integer.c index 6dbc2e4dc6..e82b0cc4ae 100644 --- a/epan/ftypes/ftype-integer.c +++ b/epan/ftypes/ftype-integer.c @@ -146,6 +146,15 @@ sint_from_unparsed(fvalue_t *fv, char *s, gboolean allow_partial_value _U_, LogF logfunc("\"%s\" causes an integer overflow.", s); return FALSE; } + if (value < G_MININT32) { + /* + * Fits in a long, but not in a gint32 (a long might be + * 64 bits). + */ + if (logfunc != NULL) + logfunc("\"%s\" causes an integer underflow.", s); + return FALSE; + } fv->value.sinteger = (gint32)value; return TRUE; |