mirror of
https://github.com/owntone/owntone-server.git
synced 2025-11-09 05:34:58 -05:00
Fix URL handling for parameters with either an ampersand (&) or and equal (=). Patches from Stephen Lee fixing a bug reported by Peter Gutbrod.
This commit is contained in:
@@ -887,9 +887,11 @@ void config_set_status(WS_CONNINFO *pwsc, int session, char *fmt, ...) {
|
||||
va_list ap;
|
||||
SCAN_STATUS *pfirst, *plast;
|
||||
|
||||
DPRINTF(ERR_DEBUG,"Entering config_set_status\n");
|
||||
|
||||
if(config_mutex_lock()) {
|
||||
/* we should really shutdown the app here... */
|
||||
exit(EXIT_FAILURE);
|
||||
DPRINTF(ERR_FATAL,"Error acquiring config mutex\n");
|
||||
}
|
||||
|
||||
pfirst=plast=scan_status.next;
|
||||
@@ -921,6 +923,7 @@ void config_set_status(WS_CONNINFO *pwsc, int session, char *fmt, ...) {
|
||||
} else {
|
||||
if(!pfirst) {
|
||||
config_mutex_unlock();
|
||||
DPRINTF(ERR_DEBUG,"Exiting config_set_status\n");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -938,6 +941,7 @@ void config_set_status(WS_CONNINFO *pwsc, int session, char *fmt, ...) {
|
||||
}
|
||||
|
||||
config_mutex_unlock();
|
||||
DPRINTF(ERR_DEBUG,"Exiting config_set_status\n");
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -616,19 +616,18 @@ int ws_getheaders(WS_CONNINFO *pwsc) {
|
||||
int ws_getgetvars(WS_CONNINFO *pwsc, char *string) {
|
||||
char *new_string;
|
||||
char *first, *last, *middle;
|
||||
char *key, *value;
|
||||
int done;
|
||||
|
||||
DPRINTF(ERR_DEBUG,"Thread %d: Original string: %s\n",
|
||||
pwsc->threadno,string);
|
||||
|
||||
new_string=ws_urldecode(string);
|
||||
|
||||
DPRINTF(ERR_DEBUG,"Thread %d: Processing GET/POSTs from %s\n",
|
||||
pwsc->threadno,string);
|
||||
|
||||
done=0;
|
||||
|
||||
first=new_string;
|
||||
first=string;
|
||||
|
||||
while((!done) && (first)) {
|
||||
last=middle=first;
|
||||
@@ -639,9 +638,15 @@ int ws_getgetvars(WS_CONNINFO *pwsc, char *string) {
|
||||
DPRINTF(ERR_WARN,"Thread %d: Bad arg: %s\n",
|
||||
pwsc->threadno,first);
|
||||
} else {
|
||||
key=ws_urldecode(first);
|
||||
value=ws_urldecode(middle);
|
||||
|
||||
DPRINTF(ERR_DEBUG,"Thread %d: Adding arg %s = %s\n",
|
||||
pwsc->threadno,first,middle);
|
||||
ws_addarg(&pwsc->request_vars,first,"%s",middle);
|
||||
pwsc->threadno,key,value);
|
||||
ws_addarg(&pwsc->request_vars,key,"%s",value);
|
||||
|
||||
free(key);
|
||||
free(value);
|
||||
}
|
||||
|
||||
if(!last) {
|
||||
@@ -653,7 +658,6 @@ int ws_getgetvars(WS_CONNINFO *pwsc, char *string) {
|
||||
}
|
||||
}
|
||||
|
||||
free(new_string);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user