mirror of
https://github.com/alsa-project/alsa-tools.git
synced 2026-03-28 07:58:25 -04:00
Fix for segmentation fault in envy24control
a user has written he has a segmentation fault if he use the profiles management. He has used some older version of alsa-tools with previous FC releases until now and then this problem didn't exists. I have found a array boundary fault in my code for strstr_icase_blank(). From: Dirk Kalis <dirk.kalis@t-online.de>
This commit is contained in:
parent
632a2ae802
commit
961ee03200
1 changed files with 2 additions and 2 deletions
|
|
@ -59,7 +59,7 @@ int strstr_icase_blank(const char * const string1, const char * const string2)
|
||||||
{
|
{
|
||||||
if ((pos_first_non_blank < 0) && (!isblank(search_string[i])))
|
if ((pos_first_non_blank < 0) && (!isblank(search_string[i])))
|
||||||
pos_first_non_blank = i;
|
pos_first_non_blank = i;
|
||||||
search_string[i] = toupper(search_string[i]);
|
search_string[i] = (char)toupper(search_string[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// replace blanks in search string with SEP_CHAR to compare without blanks
|
// replace blanks in search string with SEP_CHAR to compare without blanks
|
||||||
|
|
@ -91,7 +91,7 @@ int strstr_icase_blank(const char * const string1, const char * const string2)
|
||||||
while (position < strlen(string1))
|
while (position < strlen(string1))
|
||||||
{
|
{
|
||||||
strncpy(line, (string1 + (position * sizeof(char))), MAX_SEARCH_FIELD_LENGTH);
|
strncpy(line, (string1 + (position * sizeof(char))), MAX_SEARCH_FIELD_LENGTH);
|
||||||
line[MAX_SEARCH_FIELD_LENGTH] = '\0';
|
line[MAX_SEARCH_FIELD_LENGTH - 1] = '\0';
|
||||||
pos_first_non_blank = -1;
|
pos_first_non_blank = -1;
|
||||||
for (i = 0; i < strlen(line); i++)
|
for (i = 0; i < strlen(line); i++)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue