<p>neels <strong>submitted</strong> this change.</p><p><a href="https://gerrit.osmocom.org/c/osmo-ci/+/25466">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, but someone else must approve
  neels: Looks good to me, approved

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">lint: checkpatch.pl: add STRCPY_OSMO<br><br>Add Osmocom specific check to forbid using strncpy() and strcpy().<br>Instead, osmo_strlcpy() or OSMO_STRLCPY_ARRAY() should be used.<br><br>Related: OS#5087<br>Related: https://lists.osmocom.org/pipermail/openbsc/2021-September/013538.html<br>Change-Id: I6fa96c8f3d15110dd3d3509faa593285a78f469e<br>---<br>M lint/checkpatch/checkpatch.pl<br>1 file changed, 7 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/lint/checkpatch/checkpatch.pl b/lint/checkpatch/checkpatch.pl</span><br><span>index 059a2a6..06e6e36 100755</span><br><span>--- a/lint/checkpatch/checkpatch.pl</span><br><span>+++ b/lint/checkpatch/checkpatch.pl</span><br><span>@@ -7201,6 +7201,13 @@</span><br><span>                          "Where possible, use lockdep_assert_held instead of assertions based on spin_is_locked\n" . $herecurr);</span><br><span>               }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+# Osmocom specific: check for strncpy(), strcpy()</span><br><span style="color: hsl(120, 100%, 40%);">+# https://lists.osmocom.org/pipermail/openbsc/2021-September/013538.html</span><br><span style="color: hsl(120, 100%, 40%);">+            if ($line =~ /\bstr(n)?cpy\(/) {</span><br><span style="color: hsl(120, 100%, 40%);">+                      ERROR("STRCPY_OSMO",</span><br><span style="color: hsl(120, 100%, 40%);">+                              "Instead of strncpy()/strcpy(), use osmo_strlcpy() or OSMO_STRLCPY_ARRAY()\n" . $herecurr);</span><br><span style="color: hsl(120, 100%, 40%);">+           }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> # check for deprecated apis</span><br><span>           if ($line =~ /\b($deprecated_apis_search)\b\s*\(/) {</span><br><span>                         my $deprecated_api = $1;</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-ci/+/25466">change 25466</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.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://gerrit.osmocom.org/c/osmo-ci/+/25466"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-ci </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I6fa96c8f3d15110dd3d3509faa593285a78f469e </div>
<div style="display:none"> Gerrit-Change-Number: 25466 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: osmith <osmith@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: neels <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>