-
Notifications
You must be signed in to change notification settings - Fork 31
Open
Description
Crashes immediately:
$ AlsaMixer.app
*** buffer overflow detected ***: terminated
Program received signal SIGABRT, Aborted.
It seems this line forgot to allocate memory for the null character:
--- a/AlsaMixer.app/AMixer/AMixer.cc
+++ b/AlsaMixer.app/AMixer/AMixer.cc
@@ -23,7 +23,7 @@ AMixer::AMixer(const char *card) {
int err;
if (card) {
- cardName = new char[std::strlen(card)];
+ cardName = new char[std::strlen(card) + 1];
std::strcpy(cardName, card);
for (int i = 0; i < MIXER_ITEMS; i++)
mixerItems[i] = NULL;Metadata
Metadata
Assignees
Labels
No labels