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:
parent
21090cab5d
commit
b601daa819
|
@ -390,12 +390,14 @@ QWidget * ExtArgNumber::createEditor(QWidget * parent)
|
||||||
val = extcap_complex_get_int(_argument->range_start);
|
val = extcap_complex_get_int(_argument->range_start);
|
||||||
else if ( _argument->arg_type == EXTCAP_ARG_UNSIGNED )
|
else if ( _argument->arg_type == EXTCAP_ARG_UNSIGNED )
|
||||||
{
|
{
|
||||||
val = extcap_complex_get_uint(_argument->range_start);
|
guint tmp = extcap_complex_get_uint(_argument->range_start);
|
||||||
if ( val > G_MAXINT )
|
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 );
|
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;
|
val = G_MAXINT;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
val = (gint)tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
textValidator->setBottom(val);
|
textValidator->setBottom(val);
|
||||||
|
@ -413,12 +415,14 @@ QWidget * ExtArgNumber::createEditor(QWidget * parent)
|
||||||
val = extcap_complex_get_int(_argument->range_end);
|
val = extcap_complex_get_int(_argument->range_end);
|
||||||
else if ( _argument->arg_type == EXTCAP_ARG_UNSIGNED )
|
else if ( _argument->arg_type == EXTCAP_ARG_UNSIGNED )
|
||||||
{
|
{
|
||||||
val = extcap_complex_get_uint(_argument->range_end);
|
guint tmp = extcap_complex_get_uint(_argument->range_end);
|
||||||
if ( val > G_MAXINT )
|
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 );
|
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;
|
val = G_MAXINT;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
val = (gint)tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
textValidator->setTop(val);
|
textValidator->setTop(val);
|
||||||
|
|
Loading…
Reference in New Issue