check that friends db value is JSON array

This commit is contained in:
Jan-Piet Mens
2016-02-23 17:29:52 +01:00
parent 81399aa406
commit 4d7dcf2007

8
http.c
View File

@@ -408,6 +408,14 @@ JsonNode *populate_friends(struct mg_connection *conn, char *u, char *d)
free(js);
}
if (friends == NULL) {
return (results);
}
if (friends->tag != JSON_ARRAY) {
olog(LOG_ERR, "expecting value of friends:%s to be an array", UB(userdevice));
return (results);
}
/*
* Run through the array of friends of this user. Get LAST object,
* which contains CARD and LOCATION data. Create an array of