]> git.ipfire.org Git - thirdparty/asterisk.git/commit
res_fax: validate the remote/local Station ID for UTF-8 format
authorAlexei Gradinari <alex2grad@gmail.com>
Tue, 23 Feb 2021 16:14:10 +0000 (11:14 -0500)
committerJoshua Colp <jcolp@sangoma.com>
Tue, 2 Mar 2021 17:17:02 +0000 (11:17 -0600)
commitd5e73d2121b80dbe8b381086f6c3fc1578dd9609
treef009333dad223fc3b00ca7ab8fe0e1112c45d1e4
parent6673c1b177d42601c8d4b0b3358785a646321df1
res_fax: validate the remote/local Station ID for UTF-8 format

If the remote Station ID contains invalid UTF-8 characters
the asterisk fails to publish the Stasis and ReceiveFax status messages.

json.c: Error building JSON from '{s: s, s: s}': Invalid UTF-8 string.
0: /usr/sbin/asterisk(ast_json_vpack+0x98) [0x4f3f28]
1: /usr/sbin/asterisk(ast_json_pack+0x8c) [0x4f3fcc]
2: /usr/sbin/asterisk(ast_channel_publish_varset+0x2b) [0x57aa0b]
3: /usr/sbin/asterisk(pbx_builtin_setvar_helper+0x121) [0x530641]
4: /usr/lib64/asterisk/modules/res_fax.so(+0x44fe) [0x7f27f4bff4fe]
...
stasis_channels.c: Error creating message

json.c: Error building JSON from '{s: s, s: s, s: s, s: s, s: s, s: s, s: o}': Invalid UTF-8 string.
0: /usr/sbin/asterisk(ast_json_vpack+0x98) [0x4f3f28]
1: /usr/sbin/asterisk(ast_json_pack+0x8c) [0x4f3fcc]
2: /usr/lib64/asterisk/modules/res_fax.so(+0x5acd) [0x7f27f4c00acd]
...
res_fax.c: Error publishing ReceiveFax status message

This patch replaces the invalid UTF-8 Station IDs with an empty string.

ASTERISK-29312 #close

Change-Id: Ieb00b6ecf67db3bfca787649caa8517f29d987db
res/res_fax.c