From: Petr Špaček Date: Tue, 9 Apr 2019 11:20:02 +0000 (+0200) Subject: doh: fix error handling around empty POST X-Git-Tag: v4.0.0~10^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fc3f6487ad42222cfd31febfaf2dc719dec6ee22;p=thirdparty%2Fknot-resolver.git doh: fix error handling around empty POST --- diff --git a/modules/http/http_doh.lua b/modules/http/http_doh.lua index 8091250a0..71d183676 100644 --- a/modules/http/http_doh.lua +++ b/modules/http/http_doh.lua @@ -30,7 +30,7 @@ local function serve_doh(h, stream) return 405, 'only HTTP POST and GET are supported' end - if #input < 12 then + if not input or #input < 12 then return 400, 'input too short' elseif #input > 1024 then return 413, 'input too long'