Re: Fix bug in argument checking in binary:matches/2

Henrik Nord <[email protected]>
Newsgroups gmane.comp.lang.erlang.patches
Message-ID <[email protected]>
On 2013-09-21 04:35, Mike Sassak wrote:
> Hi erlang-patches,
>
> Including an empty binary as one of multiple patterns to 
> binary:matches/2 crashes BEAM:
>
>     binary:matches(<<"foo">>, [<<>>, <<"f">>]). % -> Crash
>
> Passing just an empty binary, or a list containing only the empty 
> binary throws a badarg as expected:
>
>     binary:matches(<<"foo">>, <<>>) % -> badarg
>     binary:matches(<<"foo">>, [<<>>]) % -> badarg
>
> My patch ensures all patterns passed to binary:matches/2 are checked 
> for validity and throws badarg if one is not valid.
>
> You can fetch the patch with:
>
>     git fetch git://github.com/msassak/otp.git 
> <http://github.com/msassak/otp.git> empty-pattern-badarg
>
> And check out diff views here:
>
> https://github.com/msassak/otp/compare/erlang:maint...empty-pattern-badarg
> https://github.com/msassak/otp/compare/erlang:maint...empty-pattern-badarg.patch
>
> Mike
>
>
>
> _______________________________________________
> erlang-patches mailing list
> [email protected]
> http://erlang.org/mailman/listinfo/erlang-patches
Hi Mike!

I have created a pull request from your patch.
Thank you for your contribution!

-- 
/Henrik Nord Erlang/OTP

_______________________________________________
erlang-patches mailing list
[email protected]
http://erlang.org/mailman/listinfo/erlang-patches
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.