[ZBX-9904] No info string in proxy protocol response when historical data sending succeeded Created: 2015 Sep 24  Updated: 2017 May 30  Resolved: 2016 Jan 11

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Proxy (P), Server (S)
Affects Version/s: 2.2.10
Fix Version/s: 2.2.12rc1, 2.4.8rc1, 3.0.0alpha6

Type: Incident report Priority: Trivial
Reporter: Sandis Neilands (Inactive) Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: regression, response
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Function: recv_proxyhistory()

Description of the fault: after converting error string from static char buffer to dynamically allocated char buffer a sizeof() was not noticed. As a result the maximum length of the info string that is returned in the response is 8 or 4 characters (sizeof(*char) == 8 on 64bit machines and sizeof(*char) == 4 on 32bit machines).

How the user can notice the problem:
The info string is missing in the response.

Example.

{
        "response" : "success",
}

What it should have been.

{
        "response" : "success",
        "info" : "Processed 9 Failed 0 Total 9 Seconds spent 0.000462"
}

Impacts: low - Zabbix doesn't parse the info string on the other end.

Coverity: CID 118921

Regression: since ZBX-4675

Affected versions: since 2.2.4rc1

See also:
https://www.zabbix.org/wiki/Docs/protocols/zabbix_proxy/3.0
send_proxyhistory()
zbx_recv_response()



 Comments   
Comment by Glebs Ivanovskis (Inactive) [ 2016 Jan 08 ]

I changed fix versions because 2.0 is not affected. In 2.0 recv_proxyhistory() still has two static buffers info and error to pass to get_proxy_id() and process_hist_data(). ZBX-7288 optimized recv_proxyhistory() to use one static buffer, but it was done for versions 2.2 and higher. Then ZBX-4675 made get_proxy_id() work with dynamic error buffer, but did not switch back to static buffer for process_hist_data().

Comment by Glebs Ivanovskis (Inactive) [ 2016 Jan 08 ]

Fix for version 2.2 is available in development branch svn://svn.zabbix.com/branches/dev/ZBX-9904-22 revision 57500.

Comment by Sandis Neilands (Inactive) [ 2016 Jan 11 ]

(1) Looks good. In the header of process_hist_data() please describe the proper use of info (e.g. that it has to be freed).

glebs.ivanovskis Please review revision 57520. RESOLVED

Comment by Sandis Neilands (Inactive) [ 2016 Jan 11 ]

Successfully tested.

Comment by Glebs Ivanovskis (Inactive) [ 2016 Jan 11 ]

Fixed in pre-2.2.12rc1 r57523, pre-2.4.8rc1 r57524, pre-3.0.0alpha6 (trunk) r57526.

Generated at Fri Mar 29 07:44:09 EET 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.