i2ptunnel: Fix NPE on proxy.i2p/add when no params

This commit is contained in:
zzz
2017-01-07 13:55:36 +00:00
parent fc0ddb0193
commit ca440a50fe
3 changed files with 23 additions and 1 deletions

View File

@@ -127,6 +127,10 @@ public abstract class LocalHTTPServer {
// Parameters are url, host, dest, nonce, and master | router | private.
// Do the add and redirect.
if (targetRequest.equals("/add")) {
if (query == null) {
out.write(ERR_ADD.getBytes("UTF-8"));
return;
}
Map<String, String> opts = new HashMap<String, String>(8);
// this only works if all keys are followed by =value
StringTokenizer tok = new StringTokenizer(query, "=&;");