mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2026-04-03 07:15:37 -04:00
Merge branch 'fix-utf-8-range-handling' into 'master'
Fix ASCII character range check for UTF-8 See merge request pulseaudio/pulseaudio!865
This commit is contained in:
commit
32484b1804
1 changed files with 2 additions and 2 deletions
|
|
@ -150,7 +150,7 @@ static const char* parse_string(const char *str, pa_json_object *obj) {
|
||||||
if (*str != '\\') {
|
if (*str != '\\') {
|
||||||
/* JSON specifies that ASCII control characters 0x00 through 0x1F
|
/* JSON specifies that ASCII control characters 0x00 through 0x1F
|
||||||
* must not appear in the string. */
|
* must not appear in the string. */
|
||||||
if (*str < 0x20) {
|
if (*str >= 0x00 && *str < 0x20) {
|
||||||
pa_log("Invalid ASCII character: 0x%x", (unsigned int) *str);
|
pa_log("Invalid ASCII character: 0x%x", (unsigned int) *str);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
@ -763,7 +763,7 @@ static char *pa_json_escape(const char *p) {
|
||||||
*output++ = 't';
|
*output++ = 't';
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (*s < 0x20 || *s == 0x7F) {
|
if ((*s >= 0x00 && *s < 0x20) || *s == 0x7F) {
|
||||||
pa_log("Invalid ASCII character: 0x%x", (unsigned int) *s);
|
pa_log("Invalid ASCII character: 0x%x", (unsigned int) *s);
|
||||||
pa_xfree(out_string);
|
pa_xfree(out_string);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue