[pulseaudio-commits] [Git][pulseaudio/pulseaudio][master] core-util: Handle zero-length volume string

Tanu Kaskinen gitlab at gitlab.freedesktop.org
Fri Dec 27 05:41:28 UTC 2019



Tanu Kaskinen pushed to branch master at PulseAudio / pulseaudio


Commits:
4dba56c1 by Tanu Kaskinen at 2019-12-27T07:33:52+02:00
core-util: Handle zero-length volume string

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

Fixes: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/768

- - - - -


1 changed file:

- src/pulsecore/core-util.c


Changes:

=====================================
src/pulsecore/core-util.c
=====================================
@@ -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);



View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/commit/4dba56c1af96b4b93574a18e878d054e70bcaa62

-- 
View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/commit/4dba56c1af96b4b93574a18e878d054e70bcaa62
You're receiving this email because of your account on gitlab.freedesktop.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/pulseaudio-commits/attachments/20191227/8dfa9c78/attachment.htm>


More information about the pulseaudio-commits mailing list