From 07ef3c32d71cd52ea46d0469ff8c75d312c2d32e Mon Sep 17 00:00:00 2001 From: Martin Rehfeld Date: Fri, 30 Jan 2015 13:43:55 +0000 Subject: Reply with 400 on if*-match parsing crash --- src/cowboy_http.erl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/cowboy_http.erl') diff --git a/src/cowboy_http.erl b/src/cowboy_http.erl index 1cf73bf..d616f73 100644 --- a/src/cowboy_http.erl +++ b/src/cowboy_http.erl @@ -668,7 +668,9 @@ token(<< C, Rest/binary >>, Fun, Case, Acc) -> -spec quoted_string(binary(), fun()) -> any(). quoted_string(<< $", Rest/binary >>, Fun) -> - quoted_string(Rest, Fun, <<>>). + quoted_string(Rest, Fun, <<>>); +quoted_string(_, _Fun) -> + {error, badarg}. -spec quoted_string(binary(), fun(), binary()) -> any(). quoted_string(<<>>, _Fun, _Acc) -> -- cgit v1.2.3