Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
aplay: fix buffer overflow and tainted format string
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. Fixes: #246 Signed-off-by: Mingjie Shen <[email protected]> Signed-off-by: Jaroslav Kysela <[email protected]>
- Loading branch information