diff --git a/src/pulsecore/protocol-native.c b/src/pulsecore/protocol-native.c index 1287aac56..711bf4dc1 100644 --- a/src/pulsecore/protocol-native.c +++ b/src/pulsecore/protocol-native.c @@ -32,7 +32,6 @@ #include #include #include -#include #include #include #include @@ -4363,7 +4362,7 @@ static void command_set_stream_name(pa_pdispatch *pd, uint32_t command, uint32_t } CHECK_VALIDITY(c->pstream, c->authorized, tag, PA_ERR_ACCESS); - CHECK_VALIDITY(c->pstream, name && pa_utf8_valid(name), tag, PA_ERR_INVALID); + CHECK_VALIDITY(c->pstream, name, tag, PA_ERR_INVALID); if (command == PA_COMMAND_SET_PLAYBACK_STREAM_NAME) { playback_stream *s; @@ -4452,8 +4451,7 @@ static void command_load_module(pa_pdispatch *pd, uint32_t command, uint32_t tag } CHECK_VALIDITY(c->pstream, c->authorized, tag, PA_ERR_ACCESS); - CHECK_VALIDITY(c->pstream, name && *name && pa_utf8_valid(name) && !strchr(name, '/'), tag, PA_ERR_INVALID); - CHECK_VALIDITY(c->pstream, !argument || pa_utf8_valid(argument), tag, PA_ERR_INVALID); + CHECK_VALIDITY(c->pstream, name && *name && !strchr(name, '/'), tag, PA_ERR_INVALID); if (!(m = pa_module_load(c->protocol->core, name, argument))) { pa_pstream_send_error(c->pstream, tag, PA_ERR_MODINITFAILED); @@ -4656,7 +4654,6 @@ static void command_extension(pa_pdispatch *pd, uint32_t command, uint32_t tag, } CHECK_VALIDITY(c->pstream, c->authorized, tag, PA_ERR_ACCESS); - CHECK_VALIDITY(c->pstream, !name || pa_utf8_valid(name), tag, PA_ERR_INVALID); CHECK_VALIDITY(c->pstream, idx != PA_INVALID_INDEX || name, tag, PA_ERR_INVALID); CHECK_VALIDITY(c->pstream, idx == PA_INVALID_INDEX || !name, tag, PA_ERR_INVALID); CHECK_VALIDITY(c->pstream, !name || idx == PA_INVALID_INDEX, tag, PA_ERR_INVALID); diff --git a/src/pulsecore/tagstruct.c b/src/pulsecore/tagstruct.c index 4f7e8151e..8c1e5a097 100644 --- a/src/pulsecore/tagstruct.c +++ b/src/pulsecore/tagstruct.c @@ -33,6 +33,7 @@ #include #endif +#include #include #include @@ -346,6 +347,9 @@ int pa_tagstruct_gets(pa_tagstruct*t, const char **s) { if (error) return -1; + if (!pa_utf8_valid((char *) (t->data + t->rindex + 1))) + return -1; + *s = (char*) (t->data+t->rindex+1); t->rindex += n+2;