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

Wrong variable used when processing "mode" parameter of forecast() function

XMLWordPrintable

      Found by Coverity (CID 153297) as uninitialized variable mode usage, but actually mode is used instead of mode_str. Fix is trivial:

      Index: src/libs/zbxalgo/prediction.c
      ===================================================================
      --- src/libs/zbxalgo/prediction.c	(revision 62923)
      +++ src/libs/zbxalgo/prediction.c	(working copy)
      @@ -908,7 +908,7 @@
       
       int	zbx_mode_code(char *mode_str, zbx_mode_t *mode, char **error)
       {
      -	if ('\0' == *mode || 0 == strcmp(mode_str, "value"))
      +	if ('\0' == *mode_str || 0 == strcmp(mode_str, "value"))
       	{
       		*mode = MODE_VALUE;
       	}
      

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

              Created:
              Updated:
              Resolved: