<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><span class="vcard"><a class="email" href="mailto:piotr.szeplik@nsn.com" title="piotr.szeplik@nsn.com">piotr.szeplik@nsn.com</a>
</span> changed
              <a class="bz_bug_link 
          bz_status_REOPENED "
   title="REOPENED --- - AddressSanitizer reports false positive global-buffer-overflow."
   href="http://llvm.org/bugs/show_bug.cgi?id=20473">bug 20473</a>
        <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Status</td>
           <td>RESOLVED
           </td>
           <td>REOPENED
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Resolution</td>
           <td>INVALID
           </td>
           <td>---
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_REOPENED "
   title="REOPENED --- - AddressSanitizer reports false positive global-buffer-overflow."
   href="http://llvm.org/bugs/show_bug.cgi?id=20473#c3">Comment # 3</a>
              on <a class="bz_bug_link 
          bz_status_REOPENED "
   title="REOPENED --- - AddressSanitizer reports false positive global-buffer-overflow."
   href="http://llvm.org/bugs/show_bug.cgi?id=20473">bug 20473</a>
              from <span class="vcard"><a class="email" href="mailto:piotr.szeplik@nsn.com" title="piotr.szeplik@nsn.com">piotr.szeplik@nsn.com</a>
</span></b>
        <pre>(In reply to <a href="show_bug.cgi?id=20473#c2">comment #2</a>)
<span class="quote">> Isn't this an actual bug in the code that asan correctly reports? 

> You are initializing a char array of 3 elements with "",
> which is a char array with 2 elements.</span >

This is correct. It is guaranteed by the standard (section 8.5.2
[dcl.init.string] paragraph number 3) where you can read:
"If there are fewer initializers than there are array elements, each element
not explicitly initialized shall be zero-initialized."

Please also notice that the issue disappear if you change a layout of the
structure like below:

struct test
{
    char b[3];
    char a[2];
};

<span class="quote">> (Please reopen the bug if you disagree)</span >

OK.

Best regards,</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>