diff options
author | Lars-Dominik Braun <PromyLOPh@lavabit.com> | 2010-07-31 18:12:48 +0200 |
---|---|---|
committer | Lars-Dominik Braun <PromyLOPh@lavabit.com> | 2010-07-31 18:12:48 +0200 |
commit | b01e650546075f574068d89eb58101a88a8f5ed2 (patch) | |
tree | 1150b7ea5d147315e07efa4eae9bfd8fed500d58 /src | |
parent | 1dac515822e85646c2539d2c6261a9c55b6802ab (diff) | |
download | pianobar-windows-b01e650546075f574068d89eb58101a88a8f5ed2.tar.gz pianobar-windows-b01e650546075f574068d89eb58101a88a8f5ed2.tar.bz2 pianobar-windows-b01e650546075f574068d89eb58101a88a8f5ed2.zip |
Fix genre station NULL pointer dereference
Obviously pandora changed the genre station api. Attention: Incompatible
libpiano abi change.
Diffstat (limited to 'src')
-rw-r--r-- | src/ui.c | 22 |
1 files changed, 11 insertions, 11 deletions
@@ -445,7 +445,7 @@ void BarStationFromGenre (PianoHandle_t *ph, WaitressHandle_t *waith, FILE *curF PianoReturn_t pRet; WaitressReturn_t wRet; PianoGenreCategory_t *curCat; - PianoStation_t *curStation; + PianoGenre_t *curGenre; PianoRequestDataCreateStation_t reqData; int i; @@ -481,26 +481,26 @@ void BarStationFromGenre (PianoHandle_t *ph, WaitressHandle_t *waith, FILE *curF } /* print all available stations */ - curStation = curCat->stations; + curGenre = curCat->genres; i = 0; - while (curStation != NULL) { - BarUiMsg (MSG_LIST, "%2i) %s\n", i, curStation->name); + while (curGenre != NULL) { + BarUiMsg (MSG_LIST, "%2i) %s\n", i, curGenre->name); i++; - curStation = curStation->next; + curGenre = curGenre->next; } BarUiMsg (MSG_QUESTION, "Select genre: "); if (BarReadlineInt (&i, curFd) == 0) { return; } - curStation = curCat->stations; - while (curStation != NULL && i > 0) { - curStation = curStation->next; + curGenre = curCat->genres; + while (curGenre != NULL && i > 0) { + curGenre = curGenre->next; i--; } /* create station */ - BarUiMsg (MSG_INFO, "Adding shared station \"%s\"... ", curStation->name); - reqData.id = curStation->id; - reqData.type = "sh"; + BarUiMsg (MSG_INFO, "Adding shared station \"%s\"... ", curGenre->name); + reqData.id = curGenre->musicId; + reqData.type = "mi"; BarUiPianoCall (ph, PIANO_REQUEST_CREATE_STATION, waith, &reqData, &pRet, &wRet); } |