aplay: fix buffer overflow and tainted format string
alsa-project/alsa-utils pull request #246 was opened from szsam:
Prior this commit, memcpy from names[0] to format[] will overwrite if strlen(names[0]) is greater than 1024. Also, the length of malloc()ed names[channel] is insufficient, leading to another buffer overwriting when calling sprintf(). Moreover, the format string of sprintf() can be controlled by user input. An attacker can exploit this weakness to crash the program, disclose information or even execute arbitrary code.
Fix by allocating enough space for arrays and using constant expressions as the format strings.
Request URL : https://github.com/alsa-project/alsa-utils/pull/246 Patch URL : https://github.com/alsa-project/alsa-utils/pull/246.patch Repository URL: https://github.com/alsa-project/alsa-utils
participants (1)
-
GitHub pull_request - opened