Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-11704

Incorrect check for a whole number

XMLWordPrintable

    • Sprint 1

      In src/libs/zbxserver/evalfunc.c add_value_suffix_normal() uses the following expressions to check if a value has no fractional part:

      if (SUCCEED != zbx_double_compare((int)(value_double + 0.5), value_double))
      

      Converting double to int may cause overflow and lead to unexpected results.

      A more delicate way of doing the same thing:

      if (SUCCEED != zbx_double_compare(round(value_double) - value_double, 0.0))
      

            Unassigned Unassigned
            glebs.ivanovskis Glebs Ivanovskis (Inactive)
            Team A
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: