<h3>Contribution description</h3>
<p><code>uri_parser_process()</code> takes a <code>const char *</code> as input parameter but the result is a struct of <code>char *</code> to the original string.</p>
<p>This may lead a user to modifying the strings in <code>uri_parser_result_t</code> which will cause a crash if the original string resides in read-only memory (and violates the no-modifications promise of the const parameter in <code>uri_parser_process()</code>).</p>
<p>To fix this, make the resulting strings <code>const</code> as well, so nobody dares to touch them in a writing way.</p>
<h3>Testing procedure</h3>
<div class="snippet-clipboard-content position-relative" data-snippet-clipboard-copy-content="make -C tests/unittests tests-uri_parser all term
"><pre><code>make -C tests/unittests tests-uri_parser all term
</code></pre></div>
<h3>Issues/PRs references</h3>
<p><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="956714045" data-permission-text="Title is private" data-url="https://github.com/RIOT-OS/RIOT/issues/16695" data-hovercard-type="pull_request" data-hovercard-url="/RIOT-OS/RIOT/pull/16695/hovercard?comment_id=681820654&comment_type=review_comment" href="https://github.com/RIOT-OS/RIOT/pull/16695#discussion_r681820654">#16695 (comment)</a></p>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>  <a href='https://github.com/RIOT-OS/RIOT/pull/16707'>https://github.com/RIOT-OS/RIOT/pull/16707</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>uri_parser: constify result</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/RIOT-OS/RIOT/pull/16707/files#diff-5e2dc05e4b8272cb7c36c6ccca4c6c6a4866034f4387f1c139039725eaa5e51b">sys/include/uri_parser.h</a>
    (20)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/RIOT-OS/RIOT/pull/16707/files#diff-05fd96efad40b0211dd1f6c15d061bc4c810f3b9f0c18eb5d33b054413aa6d75">sys/uri_parser/uri_parser.c</a>
    (56)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/RIOT-OS/RIOT/pull/16707.patch'>https://github.com/RIOT-OS/RIOT/pull/16707.patch</a></li>
  <li><a href='https://github.com/RIOT-OS/RIOT/pull/16707.diff'>https://github.com/RIOT-OS/RIOT/pull/16707.diff</a></li>
</ul>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/RIOT-OS/RIOT/pull/16707">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABE7WYCIZKIEICGKKBJZ4M3T3EUTBANCNFSM5BQ7CKIQ">unsubscribe</a>.<br />Triage notifications on the go with GitHub Mobile for <a href="https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675">iOS</a> or <a href="https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email">Android</a>.<img src="https://github.com/notifications/beacon/ABE7WYCG27S35PJ4H2SX2TLT3EUTBA5CNFSM5BQ7CKI2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4OJ5VL3Q.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/RIOT-OS/RIOT/pull/16707",
"url": "https://github.com/RIOT-OS/RIOT/pull/16707",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>