<p></p>
<p><b>@JKRhb</b> commented on this pull request.</p>

<hr>

<p>In <a href="https://github.com/RIOT-OS/RIOT/pull/15508#discussion_r532048443">sys/net/application_layer/dhcpv6/client.c</a>:</p>
<pre style='color:#555'>> @@ -247,6 +247,17 @@ static inline size_t _compose_elapsed_time_opt(dhcpv6_opt_elapsed_time_t *time)
     return len + sizeof(dhcpv6_opt_t);
 }
 
+static inline size_t _compose_mud_url_opt(dhcpv6_opt_mud_url_t *mud_url_opt,
+                                          char mud_url[])
+{
+    uint16_t len = strlen(mud_url);
+
+    mud_url_opt->type = byteorder_htons(DHCPV6_OPT_MUD_URL);
+    mud_url_opt->len = byteorder_htons(len);
+    strcpy(mud_url_opt->mudString, mud_url);
</pre>
<blockquote>
<blockquote>
<p>Would using <code>strncpy</code> instead of <code>strcpy</code> solve this problem?</p>
</blockquote>
<p>Only if truncated URLs are still of any value</p>
</blockquote>
<p>Hmm, probably not. The enlarged buffer should, however, minimize the risk of truncation. Or is there maybe a more robust and/or elegant way to prevent such a scenario?</p>
<blockquote>
<blockquote>
<p>I assume the length of the send buffer should be increased by 255 Bytes (or in accordance to the total length of the MUD option) if the <code>gnrc_dhcpv6_client_mud_url</code> pseudo-module is used?</p>
</blockquote>
<p>Yea something like</p>
<div class="highlight highlight-source-c"><pre>#<span class="pl-k">ifdef</span> MODULE_GNRC_DHCPV6_CLIENT_MUD_URL
#<span class="pl-k">define</span> <span class="pl-en">DHCPV6_CLIENT_BUFLEN</span>        (<span class="pl-c1">512</span>)
#<span class="pl-k">else</span> 
#<span class="pl-k">define</span> <span class="pl-en">DHCPV6_CLIENT_BUFLEN</span>        (<span class="pl-c1">256</span>)
#<span class="pl-k">endif</span></pre></div>
<p>although it would probably be enough to only enlarge the send buffer</p>
</blockquote>
<p>Would the addition of something like</p>
<div class="highlight highlight-source-c"><pre>#<span class="pl-k">ifdef</span> MODULE_GNRC_DHCPV6_CLIENT_MUD_URL
#<span class="pl-k">define</span> <span class="pl-en">DHCPV6_CLIENT_SEND_BUFLEN</span>        (DHCPV6_CLIENT_BUFLEN)
#<span class="pl-k">else</span> 
#<span class="pl-k">define</span> <span class="pl-en">DHCPV6_CLIENT_SEND_BUFLEN</span>        (DHCPV6_CLIENT_BUFLEN + <span class="pl-c1">256</span>)
#<span class="pl-k">endif</span></pre></div>
<p>in <code>client.c</code> be a good solution?</p>

<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/15508#discussion_r532048443">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABE7WYCL54HOCFJJTDWFGWTSSEFDRANCNFSM4UDVASDQ">unsubscribe</a>.<img src="https://github.com/notifications/beacon/ABE7WYB263SFNYS3YGDQR43SSEFDRA5CNFSM4UDVASD2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOEA2YYOY.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/15508#discussion_r532048443",
"url": "https://github.com/RIOT-OS/RIOT/pull/15508#discussion_r532048443",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>