-
Problem report
-
Resolution: Fixed
-
Trivial
-
7.0.0alpha2
-
None
-
Sprint 101 (Jun 2023), Sprint 102 (Jul 2023), Sprint 103 (Aug 2023)
-
0.5
Various items that work with text allow the user to specify the encoding, so that agent could convert it to UTF-8 first to uniformly process this text line-by-line.
If user makes an error and specifies an item with non-existing encoding like:
vfs.file.contents[/home/zabbix/files_encodings/hosts,BADGER_3923]
then iconv library will detect that this encoding is invalid, but Zabbix will ignore this error and simply return the text as it was already converted:
zbx_convert_to_utf8() ... if ('\0' == *encoding || (iconv_t)-1 == (cd = iconv_open(to_code, encoding))) { res = cd; memcpy(out, in, in_size); out[in_size] = '\0'; return out; }
Same is for agent 2.
This would result zabbix treating lets say UTF-16 text as UTF-8.
Of course this would lead to various undesired behaviours.
Zabbix agents must not ignore the iconv_open() function -1 error code and make an item unsupported.
Issue was raised in ZBX-21547 , check subissues 1 and 4
- caused by
-
ZBX-21547 Agent2 keys: regexp,regmatch fails with encoding UTF16LE.
- Closed