extcap (CID 1355644): fix the range check for guint

by using a temporary variable

Change-Id: I4f1f51a9fd600356839cbb44f099965058556bf0
Reviewed-on: https://code.wireshark.org/review/15340
Reviewed-by: Dario Lombardo <lomato@gmail.com>
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
This commit is contained in:
Martin Kaiser 2016-05-10 22:36:41 +02:00 committed by João Valverde
parent 21090cab5d
commit b601daa819
1 changed files with 8 additions and 4 deletions

View File

@ -390,12 +390,14 @@ QWidget * ExtArgNumber::createEditor(QWidget * parent)
val = extcap_complex_get_int(_argument->range_start);
else if ( _argument->arg_type == EXTCAP_ARG_UNSIGNED )
{
val = extcap_complex_get_uint(_argument->range_start);
if ( val > G_MAXINT )
guint tmp = extcap_complex_get_uint(_argument->range_start);
if ( tmp > G_MAXINT )
{
g_log(LOG_DOMAIN_CAPTURE, G_LOG_LEVEL_DEBUG, "Defined value for range_start of %s exceeds valid integer range", _argument->call );
val = G_MAXINT;
}
else
val = (gint)tmp;
}
textValidator->setBottom(val);
@ -413,12 +415,14 @@ QWidget * ExtArgNumber::createEditor(QWidget * parent)
val = extcap_complex_get_int(_argument->range_end);
else if ( _argument->arg_type == EXTCAP_ARG_UNSIGNED )
{
val = extcap_complex_get_uint(_argument->range_end);
if ( val > G_MAXINT )
guint tmp = extcap_complex_get_uint(_argument->range_end);
if ( tmp > G_MAXINT )
{
g_log(LOG_DOMAIN_CAPTURE, G_LOG_LEVEL_DEBUG, "Defined value for range_end of %s exceeds valid integer range", _argument->call );
val = G_MAXINT;
}
else
val = (gint)tmp;
}
textValidator->setTop(val);