dangerous code for define with + or -

XMLWordPrintable

    • Type: Incident report
    • Resolution: Fixed
    • Priority: Minor
    • 2.1.9
    • Affects Version/s: 2.0.9
    • Component/s: Server (S)
    • None

      There are many dangerous in Zabbix any versions.

      For example, in include/db.h
      #define TRIGGER_EXPRESSION_LEN_MAX TRIGGER_EXPRESSION_LEN+1

      It should be with bracket () like following
      #define TRIGGER_EXPRESSION_LEN_MAX (TRIGGER_EXPRESSION_LEN+1)

      The reason is following
      int a = TRIGGER_EXPRESSION_LEN_MAX * 4;

      The programer think a is TRIGGER_EXPRESSION_LEN * 4 + 4. But a is TRIGGER_EXPRESSION_LEN + 4.
      It is just amateurs' miss!

            Assignee:
            Unassigned
            Reporter:
            MATSUDA Daiki
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: