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

Logically dead code in JSON Path parser

    XMLWordPrintable

Details

    • Team C
    • Sprint 33, Sprint 34
    • 0.125

    Description

      The code below increments pos in a loop while 0 != isdigit(next[pos]), but on the first iteration next[pos] is the same as *next and since the loop is placed inside if (0 != isdigit(*next)) it is guaranteed that at least one iteration of the loop and at least one pos++ will be executed. As a consequence if (0 == pos) block is logically dead.

      /* process array index component */
      if (0 != isdigit(*next))
      {
      	for (pos = 0; 0 != isdigit(next[pos]); pos++)
      		;
      
      	if (0 == pos)
      		return zbx_jsonpath_error(*pnext);
      
      	...
      

      Attachments

        Issue Links

          Activity

            People

              MVekslers Michael Veksler
              glebs.ivanovskis Glebs Ivanovskis (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: