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

facebook c static analyzer infer found 402 issues in zabbix codebase

XMLWordPrintable

    • Icon: Incident report Incident report
    • Resolution: Unresolved
    • Icon: Trivial Trivial
    • None
    • 5.4.0alpha2
    • Proxy (P), Server (S)
    • None

      Summary of the reports
      UNINITIALIZED_VALUE: 255
      NULL_DEREFERENCE: 66
      DEAD_STORE: 65
      MEMORY_LEAK: 10
      USE_AFTER_FREE: 6

      I checked the errors it raised - most of them look legitimate.

      For example, NULL_DEREFERENCE error is the following:

      src/zabbix_server/alerter/alert_manager.c:825: error: NULL_DEREFERENCE
        pointer `alertpool` last assigned on line 817 could be null and is dereferenced at line 825, column 2.
        823.          /* requeue media type if the number of parallel alerts has not yet reached */
        824.          mediatype->alerts_num++;
        825. >        alertpool->alerts_num++;
      

      which is a legimitate bug, since alertpool is initialized above:
      alertpool = am_pop_alertpool(mediatype);
      and am_pop_alertpool() function can return NULL which never gets checked.

      It is very easy to install infer (check https://fbinfer.com/docs/analyzing-apps-or-projects/)
      running

      infer run -- make
      

      in the zabbix directory produces the report (attached to this ticket).

            zabbix.dev Zabbix Development Team
            arimdjonoks Artjoms Rimdjonoks
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: