Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Evergreen:11.2:Test
grip
grip-cddb-overflow.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File grip-cddb-overflow.patch of Package grip
--- grip-3.2.0/src/discdb.c +++ grip-3.2.0/src/discdb.c @@ -311,7 +311,7 @@ query->query_match=MATCH_EXACT; query->query_matches=0; - while((inbuffer=DiscDBReadLine(&dataptr))) { + while(query->query_matches < MAX_INEXACT_MATCHES && (inbuffer=DiscDBReadLine(&dataptr))) { query->query_list[query->query_matches].list_genre= DiscDBGenreValue(g_strstrip(strtok(inbuffer," "))); @@ -331,7 +331,7 @@ query->query_match=MATCH_INEXACT; query->query_matches=0; - while((inbuffer=DiscDBReadLine(&dataptr))) { + while(query->query_matches < MAX_INEXACT_MATCHES && (inbuffer=DiscDBReadLine(&dataptr))) { query->query_list[query->query_matches].list_genre= DiscDBGenreValue(g_strstrip(strtok(inbuffer," "))); @@ -432,26 +432,30 @@ else if(!strncasecmp(inbuffer,"TTITLE",6)) { track=atoi(strtok(inbuffer+6,"=")); - if(track<numtracks) + if(track >= 0 && track<numtracks) + { len=strlen(data->data_track[track].track_name); - g_snprintf(data->data_track[track].track_name+len,256-len,"%s", + g_snprintf(data->data_track[track].track_name+len,256-len,"%s", g_strstrip(strtok(NULL,""))); + } } else if(!strncasecmp(inbuffer,"TARTIST",7)) { data->data_multi_artist=TRUE; track=atoi(strtok(inbuffer+7,"=")); - if(track<numtracks) + if(track >= 0 && track<numtracks) + { len=strlen(data->data_track[track].track_artist); - st = strtok(NULL, ""); - if(st == NULL) - return; - - g_snprintf(data->data_track[track].track_artist+len,256-len,"%s", + st = strtok(NULL, ""); + if(st == NULL) + return; + + g_snprintf(data->data_track[track].track_artist+len,256-len,"%s", g_strstrip(st)); + } } else if(!strncasecmp(inbuffer,"EXTD",4)) { len=strlen(data->data_extended); @@ -461,15 +465,17 @@ else if(!strncasecmp(inbuffer,"EXTT",4)) { track=atoi(strtok(inbuffer+4,"=")); - if(track<numtracks) + if(track >= 0 && track<numtracks) + { len=strlen(data->data_track[track].track_extended); - st = strtok(NULL, ""); - if(st == NULL) - return; - - g_snprintf(data->data_track[track].track_extended+len,4096-len,"%s", + st = strtok(NULL, ""); + if(st == NULL) + return; + + g_snprintf(data->data_track[track].track_extended+len,4096-len,"%s", g_strstrip(st)); + } } else if(!strncasecmp(inbuffer,"PLAYORDER",5)) { len=strlen(data->data_playlist);
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor