distroquery.cpp: fix for previous segfault fix

This commit is contained in:
Silvan Calarco 2024-07-09 16:04:33 +02:00
parent 210494ea54
commit 112fec200e

View File

@ -1541,7 +1541,7 @@ main(int argc, char *argv[])
DistroqueryAPI *api = new DistroqueryAPI(firstconfigtag);
api->getApiResponse(&path_info[strlen(API_PREFIX)]);
exit(0);
} else {
} else if (path_info && strlen(path_info) > 0) {
cout << "Content-Type: text/html;charset=utf-8" << endl;
cout << "Status: 400 Bad request" << endl << endl;
cout << "ERROR: invalid path: " << path_info;