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

Agent2 5.2.4 integer overflow on 32-bits system

XMLWordPrintable

      On x86 / armv7 / armhf, the go agent2 fails to build:

      # zabbix.com/plugins/proc
      plugins/proc/procfs_linux.go:248:6: constant 1099511627776 overflows int
      

      strconv.Atoi returns an integer, which is 32-bits on 32-bits systems.

      Something like this fixes it:

      -               v, err := strconv.Atoi(strings.TrimSpace(line[:len(line)-2]))
      +               val, err := strconv.Atoi(strings.TrimSpace(line[:len(line)-2]))
                      if err != nil {
                              return 0, false, err
                      }
      +               v :=  int64(val)
      

            zabbix.dev Zabbix Development Team
            kdaudt Kevin Daudt
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: