diff options
author | Erlang/OTP <[email protected]> | 2019-05-15 15:16:30 +0200 |
---|---|---|
committer | Erlang/OTP <[email protected]> | 2019-05-15 15:16:30 +0200 |
commit | 70dea49bf0fc7ac7cc99e81ec15857b05e3ed98f (patch) | |
tree | 11bd53adaf191ca6f027052b48986e11375b25b0 | |
parent | 3b2c1dd3fdf1fec362cff3a88e188ef989ee79e5 (diff) | |
parent | f7ee340593a7e69eb37f9f52b903a19d65e6b22e (diff) | |
download | otp-70dea49bf0fc7ac7cc99e81ec15857b05e3ed98f.tar.gz otp-70dea49bf0fc7ac7cc99e81ec15857b05e3ed98f.tar.bz2 otp-70dea49bf0fc7ac7cc99e81ec15857b05e3ed98f.zip |
Merge branch 'lars/fix-sax-parser-bug-during-check-encoding/OTP-15826' into maint-21
* lars/fix-sax-parser-bug-during-check-encoding/OTP-15826:
[xmerl] Fix parse bug when checking the character encoding
-rw-r--r-- | lib/xmerl/src/xmerl_sax_parser.erl | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/xmerl/src/xmerl_sax_parser.erl b/lib/xmerl/src/xmerl_sax_parser.erl index fe836fd8cd..2767d02552 100644 --- a/lib/xmerl/src/xmerl_sax_parser.erl +++ b/lib/xmerl/src/xmerl_sax_parser.erl @@ -369,8 +369,8 @@ parse_eq(_, State) -> %%---------------------------------------------------------------------- parse_value(<<C, Rest/binary>>, State) when ?is_whitespace(C) -> parse_value(Rest, State); -parse_value(<<C, Rest/binary>>, _State) when C == $'; C == $" -> - parse_value_1(Rest, C, []); +parse_value(<<C, Rest/binary>>, State) when C == $'; C == $" -> + parse_value_1(Rest, C, [], State); parse_value(_, State) -> ?fatal_error(State, "\', \" or whitespace expected"). @@ -383,10 +383,12 @@ parse_value(_, State) -> %% Rest = binary() %% Description: Parsing an attribute value from the stream. %%---------------------------------------------------------------------- -parse_value_1(<<Stop, Rest/binary>>, Stop, Acc) -> +parse_value_1(<<Stop, Rest/binary>>, Stop, Acc, _State) -> {lists:reverse(Acc), Rest}; -parse_value_1(<<C, Rest/binary>>, Stop, Acc) -> - parse_value_1(Rest, Stop, [C |Acc]). +parse_value_1(<<C, Rest/binary>>, Stop, Acc, State) -> + parse_value_1(Rest, Stop, [C |Acc], State); +parse_value_1(_, _Stop, _Acc, State) -> + ?fatal_error(State, "end of input and no \' or \" found"). %%====================================================================== %% Default functions |