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

    <tr>
        <th>Summary</th>
        <td>
            UBSan: missing bounds checks when assigning  variably-modified types.
        </td>
    </tr>

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

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

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

<pre>
    
The following assignment is UB in ISO C. 

int foo(int n, char (*q)[n])
{
    char (*p)[n + 1] = q;
}

UBSan does not add any intrumentation here: https://godbolt.org/z/YfdTnezox

Also missing is a handler for this case in libsanitzer. 

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxckk2PozAMhn-NuViDaEL4OHAog5D2tIeZOewxEFOyE5JOEqbb_voV_dBWe0ks2W_s93FkCPpgiRoQLYgukWucnW9WGj_JJ4NT5wayDrL9-0w4OWPcSdsD3mQL2Yg64EeL2uKPt5_4muKt_HZqG3FyDli1RRbYK46z9AisArb_AlaDaC2IbotuurK9BYj4XHu81yKwFncgOgTe4Rfw9qHrnht_tG_SonIU0LqIUimU9ozaRr9uU8uoncWZPAHf4xzjMQDfA-uB9QenBmdi6vwBWH8B1v-a1Luli_vz3GJvgsNFh7Dx0AElztIqQx4n5zHOOuAoA21kjB6CtDpeyD_4JKrhqua1TKjZFVVdFWUuRDI3fFfnOzUIEqLKK6pKzgc5ijobaVBFnSW6YRnjWcmyneAlz1OZj1SwQnI51eWYlZBntEhtUmO-l81FokNYqSl4XbHEyIFMuK6bMUsnvCaBsW37vtk0L8N6CJBnRocY_r0SdTTUXMlu0B7WB7daFXCcafwMeJrJ3n_HlsRv6bUczPllcUpPmhTG85FCmqzeNP9x13Feh3R0C7B-63q_Xo7e_aYxAuuvswZg_dXL3wAAAP__c2jYFw">