[ZBX-4721] JSON parser does not handle \u0000 properly Created: 2012 Mar 02  Updated: 2017 May 30  Resolved: 2012 Mar 02

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Agent (G), Proxy (P), Server (S)
Affects Version/s: 1.8.10, 1.9.9 (beta)
Fix Version/s: 1.8.11, 2.0.0rc1

Type: Incident report Priority: Minor
Reporter: Alexander Vladishev Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: json
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Given an esc in text gets translated to \u001b but when transforming back to txt becomes ^Ab

      • distro/src/libs/zbxjson/json.c Sat Sep 10 03:10:56 2011
      • distro_patched/src/libs/zbxjson/json.c Tue Feb 21 12:52:38 2012
        ***************
      • 705,711 ****
        *o++ = '\t';
        break;
        case 'u':
        ! p += 2; /* "00" */
        c = zbx_hex2num(*p++) << 4;
        c += zbx_hex2num(*p);
        *o++ = (char)c;
      • 705,711 ----
        *o++ = '\t';
        break;
        case 'u':
        ! p += 3; /* "U00" REA */
        c = zbx_hex2num(*p++) << 4;
        c += zbx_hex2num(*p);
        *o++ = (char)c;


 Comments   
Comment by Alexander Vladishev [ 2012 Mar 02 ]

Fixed in versions pre-1.8.10 r25752 and pre-1.9.10 r25753.

Generated at Fri Apr 26 23:45:34 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.