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

Wrong sizeof() in str.c reported by Coverity

    Details

      Description

      In src/libs/zbxcommon/str.c in zbx_strarr_init() we have char ***arr and

      *arr = zbx_malloc(*arr, sizeof(char **));

      Similar situation in zbx_strarr_add():

      *arr = zbx_realloc(*arr, sizeof(char **) * (i + 2));

      Type of *arr is char ** and it points to char *. Therefore sizeof(char **) should be replaced with sizeof(char *).

      CID 118948 and CID 118911.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: