diff --git a/http_server.c b/http_server.c index fea8b4eb..f0d8fcc6 100644 --- a/http_server.c +++ b/http_server.c @@ -304,7 +304,7 @@ static int _reserve_str(struct http_request *r, const char **resp, const char *s static void _mover_www_form_uri_decode(char *, const char *, size_t); static int _reserve_www_form_uriencoded(struct http_request *r, const char **resp, struct substring str) { - assert(str.end > str.start); + assert(str.end >= str.start); const char *after = NULL; size_t len = www_form_uri_decode(NULL, -1, (char *)str.start, str.end - str.start, &after); assert(len <= (size_t)(str.end - str.start)); // decoded must not be longer than encoded diff --git a/tests/keyringrestful b/tests/keyringrestful index d88f601b..8cb2f59a 100755 --- a/tests/keyringrestful +++ b/tests/keyringrestful @@ -137,7 +137,7 @@ test_keyringAdd() { --output add.json \ --dump-header http.headers \ --basic --user harry:potter \ - "http://$addr_localhost:$PORTA/restful/keyring/add" + "http://$addr_localhost:$PORTA/restful/keyring/add?did=" tfw_cat http.headers add.json tfw_preserve add.json assertStdoutIs '201'