<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <br>
    <div class="moz-cite-prefix">On 2013-09-21 04:35, Mike Sassak wrote:<br>
    </div>
    <blockquote
cite="mid:CAN3v6_7ro00nZSN5cOXjNL+9RUZA4GzXwnh0n44vztzCnkFTmw@mail.gmail.com"
      type="cite">
      <div dir="ltr">Hi erlang-patches,<br>
        <div>
          <div><br>
          </div>
          <div>Including an empty binary as one of multiple patterns to
            binary:matches/2 crashes BEAM:</div>
          <div><br>
          </div>
          <div>    binary:matches(<<"foo">>,
            [<<>>, <<"f">>]). % -> Crash</div>
          <div><br>
          </div>
          <div>Passing just an empty binary, or a list containing only
            the empty binary throws a badarg as expected:</div>
          <div><br>
          </div>
          <div>    binary:matches(<<"foo">>,
            <<>>) % -> badarg</div>
          <div>    binary:matches(<<"foo">>,
            [<<>>]) % -> badarg</div>
          <div><br>
          </div>
          <div>My patch ensures all patterns passed to binary:matches/2
            are checked for validity and throws badarg if one is not
            valid.</div>
          <div><br>
          </div>
          <div>You can fetch the patch with:</div>
          <div><br>
          </div>
          <div>    git fetch git://<a moz-do-not-send="true"
              href="http://github.com/msassak/otp.git">github.com/msassak/otp.git</a>
            empty-pattern-badarg</div>
          <div><br>
          </div>
          <div>And check out diff views here:</div>
          <div><br>
          </div>
          <div>    <a moz-do-not-send="true"
href="https://github.com/msassak/otp/compare/erlang:maint...empty-pattern-badarg">https://github.com/msassak/otp/compare/erlang:maint...empty-pattern-badarg</a></div>
          <div>    <a moz-do-not-send="true"
href="https://github.com/msassak/otp/compare/erlang:maint...empty-pattern-badarg.patch">https://github.com/msassak/otp/compare/erlang:maint...empty-pattern-badarg.patch</a></div>
          <div><br>
          </div>
          <div>Mike</div>
        </div>
        <div><br>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
erlang-patches mailing list
<a class="moz-txt-link-abbreviated" href="mailto:erlang-patches@erlang.org">erlang-patches@erlang.org</a>
<a class="moz-txt-link-freetext" href="http://erlang.org/mailman/listinfo/erlang-patches">http://erlang.org/mailman/listinfo/erlang-patches</a>
</pre>
    </blockquote>
    Hi Mike!<br>
    <br>
    I have created a pull request from your patch.<br>
    Thank you for your contribution!<br>
    <pre class="moz-signature" cols="72">-- 
/Henrik Nord Erlang/OTP</pre>
  </body>
</html>