diff options
author | Lars Thorsen <[email protected]> | 2019-05-20 12:10:03 +0200 |
---|---|---|
committer | Lars Thorsen <[email protected]> | 2019-05-20 12:10:03 +0200 |
commit | f956281f92756d21bb43aa7cdc59db1cedc0eb7c (patch) | |
tree | ad0a119ccf3ed8b4a07a478d0396ce6f214d59fb /lib/xmerl | |
parent | 0aa68ff0e4b3c15c8f9cdccec8c2350dd12cdf5c (diff) | |
parent | f7ee340593a7e69eb37f9f52b903a19d65e6b22e (diff) | |
download | otp-f956281f92756d21bb43aa7cdc59db1cedc0eb7c.tar.gz otp-f956281f92756d21bb43aa7cdc59db1cedc0eb7c.tar.bz2 otp-f956281f92756d21bb43aa7cdc59db1cedc0eb7c.zip |
Merge branch 'lars/fix-sax-parser-bug-during-check-encoding/OTP-15826' into maint
* lars/fix-sax-parser-bug-during-check-encoding/OTP-15826:
[xmerl] Fix parse bug when checking the character encoding
Diffstat (limited to 'lib/xmerl')
-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 |