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

Invalid parameters to Windows functions may invoke crash

XMLWordPrintable

    • Icon: Incident report Incident report
    • Resolution: Won't fix
    • Icon: Major Major
    • None
    • 1.8.6, 1.9.4 (alpha)
    • Agent (G)

      E.g. Calling zbx_vsnprintf with count=0 will result in a crash on Windows. From vsnprintf_s description in MSDN (http://msdn.microsoft.com/en-us/library/d3xd30zz%28v=vs.80%29.aspx):
      If buffer or format is a NULL pointer, or if count is less than or equal to zero, the invalid parameter handler is invoked. If execution is allowed to continue, these functions set errno to EINVAL and return -1.

      The default invalid parameter handler causes the application to crash. Most likely a custom handler should be written, however, this would require revising return value handling for many functions, e.g., zbx_vsnprintf would behave differently on Windows if the custom handler would do nothing. Read more on MSDN:
      http://msdn.microsoft.com/en-us/library/ksazx244%28v=vs.80%29.aspx

            Unassigned Unassigned
            stoney Rudolfs Kreicbergs
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: