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

Suboptimal unsupported macro parsing

XMLWordPrintable

    • Sprint 50 (Mar 2019), Sprint 51 (Apr 2019)
    • 0.25

      When server is expanding macros in a string and detects an unsupported (by location) macro, it increments cursor position in the string and tries to find a token again. This will lead the same token being parsed and 'refused' again and again until the cursor position will reach the token.

      Instead of incrementing cursor position by 1 it should be set to the left position of the unsupported token +1. The following patch should fix it, but needs to be carefully evaluated.

      Index: src/libs/zbxserver/expression.c
      ===================================================================
      --- src/libs/zbxserver/expression.c    (revision 91057)
      +++ src/libs/zbxserver/expression.c    (working copy)
      @@ -2712,6 +2712,7 @@
               require_numeric = 0;
               N_functionid = 1;
               raw_value = 0;
      +        pos = token.loc.l;
       
               switch (token.type)
               {
      

      Still the real life impact is probably non-existant, as users will not use macros where they are not supported.

            ak Andrejs Kozlovs
            wiper Andris Zeila
            Team A
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: