mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-29 05:40:23 -04:00
json: Allow non-ASCII UTF-8 strings
Fixes: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/1398 Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/813>
This commit is contained in:
parent
3b09ca3a15
commit
874a609959
1 changed files with 4 additions and 3 deletions
|
|
@ -148,9 +148,10 @@ static const char* parse_string(const char *str, pa_json_object *obj) {
|
||||||
|
|
||||||
while (*str && *str != '"') {
|
while (*str && *str != '"') {
|
||||||
if (*str != '\\') {
|
if (*str != '\\') {
|
||||||
/* We only accept ASCII printable characters. */
|
/* JSON specifies that ASCII control characters 0x00 through 0x1F
|
||||||
if (*str < 0x20 || *str > 0x7E) {
|
* must not appear in the string. */
|
||||||
pa_log("Invalid non-ASCII character: 0x%x", (unsigned int) *str);
|
if (*str < 0x20) {
|
||||||
|
pa_log("Invalid ASCII character: 0x%x", (unsigned int) *str);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue