<p>Richard Spiegel has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/25419">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">soc/amd/common/block/pi/amd_late_init.c: Fix coverity issue CID 1387031<br><br>CID 1387031: Memory - illegal accesses (BUFFER_SIZE_WARNING). Calling<br>strncpy with a maximum size argument of 19 bytes on destination array<br>"dimm->module_part_number" of size 19 bytes might leave the destination<br>string unterminated. Fix the size parameter.<br><br>BUG=b:76202696<br>TEST=Build and boot kahlee, using special debug code to see the output<br>strings, which was later removed.<br><br>Change-Id: I18fa5e9c73401575441b6810f1db80d11666368c<br>Signed-off-by: Richard Spiegel <richard.spiegel@silverbackltd.com><br>---<br>M src/soc/amd/common/block/pi/amd_late_init.c<br>1 file changed, 1 insertion(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/19/25419/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/soc/amd/common/block/pi/amd_late_init.c b/src/soc/amd/common/block/pi/amd_late_init.c</span><br><span>index 48c1718..7c3d759 100644</span><br><span>--- a/src/soc/amd/common/block/pi/amd_late_init.c</span><br><span>+++ b/src/soc/amd/common/block/pi/amd_late_init.c</span><br><span>@@ -50,7 +50,7 @@</span><br><span>   dimm->mod_id = dmi17->ManufacturerIdCode;</span><br><span>      dimm->bank_locator = 0;</span><br><span>   strncpy((char *)dimm->module_part_number, dmi17->PartNumber,</span><br><span style="color: hsl(0, 100%, 40%);">-                              sizeof(dimm->module_part_number));</span><br><span style="color: hsl(120, 100%, 40%);">+                         sizeof(dimm->module_part_number) - 1);</span><br><span> }</span><br><span> </span><br><span> static void print_dimm_info(const struct dimm_info *dimm)</span><br><span></span><br></pre><p>To view, visit <a href="https://review.coreboot.org/25419">change 25419</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://review.coreboot.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://review.coreboot.org/25419"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: coreboot </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I18fa5e9c73401575441b6810f1db80d11666368c </div>
<div style="display:none"> Gerrit-Change-Number: 25419 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Richard Spiegel <richard.spiegel@silverbackltd.com> </div>