title: cppcheck complains Buffer is accessed out of bounds. Why and how do I fix?
body: <p>Code below to reproduce.  Is cppcheck correct to report an out of bounds error in this case?  Error is reported on line with the memcpy.</p>
  
  <pre><code>#include &lt;stdint.h&gt;
  #include &lt;string.h&gt;
  #include &lt;stdio.h&gt;
  
  typedef struct {
      uint32_t serial_number;
      uint8_t software_version[15];
  } STATIC_HARDWARE_DATA;
  
  typedef struct {
      uint16_t              result_code;  
      uint8_t               startup_type; 
      STATIC_HARDWARE_DATA  payment_data; 
  } MSG_DETAILS;
  
  int main() {
  
      MSG_DETAILS msg = {0};
      msg.result_code = 0;
      msg.startup_type = 2;
      msg.payment_data.serial_number = 0xAAAA;
      // on line below cppcheck says: Buffer is accessed out of bounds
      memcpy(msg.payment_data.software_version, "1.01A", 15);
  
      printf("%s", msg.payment_data.software_version);  // prints correct 1.01A
  
      /* in memory msg.payment_data.software_version is:
        '1', '.', '0', '1', 'A', '\0', '\0', '\0', '_', '\0', '_', 'n', '\0', 'a'
  
        The characters on end of array are unexpected?
      */
  
  }
  </code></pre>