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

Details

    Description

      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;
       	}
      

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: