summaryrefslogtreecommitdiff
path: root/libpiano
diff options
context:
space:
mode:
authorLars-Dominik Braun <PromyLOPh@lavabit.com>2009-11-28 12:07:28 +0100
committerLars-Dominik Braun <PromyLOPh@lavabit.com>2009-11-28 12:07:28 +0100
commite033ae190e67674064a2e089874b5a4185f8a654 (patch)
tree4471846f0e1f98ced1536800c8b83c69e0575b88 /libpiano
parent927a878f171580c1fdeb4d01caf0a2c9c32f8b42 (diff)
downloadpianobar-windows-e033ae190e67674064a2e089874b5a4185f8a654.tar.gz
pianobar-windows-e033ae190e67674064a2e089874b5a4185f8a654.tar.bz2
pianobar-windows-e033ae190e67674064a2e089874b5a4185f8a654.zip
piano: Fix NULL pointer dereference
Diffstat (limited to 'libpiano')
-rw-r--r--libpiano/src/http.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libpiano/src/http.c b/libpiano/src/http.c
index 98b5e11..4af5ccc 100644
--- a/libpiano/src/http.c
+++ b/libpiano/src/http.c
@@ -51,7 +51,8 @@ PianoReturn_t PianoHttpPost (WaitressHandle_t *waith, const char *postData,
waith->postData = reqPostData;
waith->method = WAITRESS_METHOD_POST;
- if (WaitressFetchBuf (waith, retData) == WAITRESS_RET_OK) {
+ if (WaitressFetchBuf (waith, retData) == WAITRESS_RET_OK &&
+ *retData != NULL) {
pRet = PIANO_RET_OK;
}
@@ -71,7 +72,8 @@ PianoReturn_t PianoHttpGet (WaitressHandle_t *waith, char **retData) {
waith->postData = NULL;
waith->method = WAITRESS_METHOD_GET;
- if (WaitressFetchBuf (waith, retData) == WAITRESS_RET_OK) {
+ if (WaitressFetchBuf (waith, retData) == WAITRESS_RET_OK &&
+ *retData != NULL) {
return PIANO_RET_OK;
}
return PIANO_RET_NET_ERROR;