add missing eof checks

This commit is contained in:
Lennart Poettering 2009-01-20 02:15:43 +01:00
parent 47a2f9e3da
commit b23efc0a4d
2 changed files with 5 additions and 2 deletions

View file

@ -366,7 +366,8 @@ int pa_context_handle_error(pa_context *c, uint32_t command, pa_tagstruct *t, pa
if (command == PA_COMMAND_ERROR) {
pa_assert(t);
if (pa_tagstruct_getu32(t, &err) < 0) {
if (pa_tagstruct_getu32(t, &err) < 0 ||
!pa_tagstruct_eof(t)) {
pa_context_fail(c, PA_ERR_PROTOCOL);
return -1;
}

View file

@ -2484,7 +2484,9 @@ static void command_create_upload_stream(pa_pdispatch *pd, uint32_t command, uin
p = pa_proplist_new();
if (c->version >= 13 && pa_tagstruct_get_proplist(t, p) < 0) {
if ((c->version >= 13 && pa_tagstruct_get_proplist(t, p) < 0) ||
!pa_tagstruct_eof(t)) {
protocol_error(c);
pa_proplist_free(p);
return;