<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/132065>132065</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Potential OOB access in getMaskVecValue in CGBuiltin.cpp
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          jurahul
      </td>
    </tr>
</table>

<pre>
    This function in CGBuiltin.cpp has this code:

```
  if (NumElts < 8) {
    int Indices[4];
    for (unsigned i = 0; i != NumElts; ++i)
      Indices[i] = i;
```

if NulElts > 4, the Indices arrays will be accessed OOB. Might be as simple as bumping the size to 8.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJxkUsFunDAQ_ZrhMgoyY2CXgw9hN1v1kKSHKncDszCpFxC2E6VfX0GJGqnSSB7P-D0_e571XvqR2UBRQ3FObAzDtJjXuNghuqSZug_zcxCP1zi2QaYRZcTTtzqKCzKm7TzjYD2G9Ug7dQz6HtQWpdpD3SPKFYGOT_H24IJH0Cc8AlUIh3prI8oY8PvYScseijqH4gz6s3edlhUdx01qh4Kgz6hA12tK2brbqdcaUA1UC1C14_ELs0Bx3uDyl_-rTFD3csWn6HaRD5gDnTAM_EmAdlnsh8d3cQ4bRtu27D13-Pxcp_go_RC2skcvt9ltWRNvs4z9RuPlN2OY8JgmndFdpSubsMkOOeUqr-iYDKZouoJ1XnFWHpouJ2pzOhRcWNalVkSJGFJUKJ1V2YFIFWmZVbrMbFcqXZVdc4Rc8c2KS517u6XT0ififWSTaVJlkTjbsPPbvIlGfsetC0Tr-Bezgu6a2HvIlRMf_D-aIMGx-TEFHoNYtz56_4HVFD2HR-t_vXD7Yl3k_3ySxMWZIYTZrx6hC9CllzDEJm2nG9BlvWZf7uZleuU2AF02cR7osqt_M_QnAAD__wld0SI">