Commit 4dba56c1 authored by Tanu Kaskinen's avatar Tanu Kaskinen
Browse files

core-util: Handle zero-length volume string

Without checking for zero we end up accessing memory outside the str
buffer: str[len - 1].

Fixes: pulseaudio/pulseaudio#768
parent cd4a6937
......@@ -879,7 +879,7 @@ int pa_parse_volume(const char *v, pa_volume_t *volume) {
len = strlen(v);
if (len >= 64)
if (len <= 0 || len >= 64)
return -1;
memcpy(str, v, len + 1);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment