<p><b>@smlng</b> requested changes on this pull request.</p>

<p>generally looks good</p><hr>

<p>In <a href="https://github.com/RIOT-OS/RIOT/pull/11737#discussion_r297172232">sys/net/gnrc/application_layer/tftp/gnrc_tftp.c</a>:</p>
<pre style='color:#555'>> @@ -233,7 +233,7 @@ static tftp_state _tftp_send_error(tftp_context_t *ctxt, gnrc_pktsnip_t *buf, tf
 static tftp_state _tftp_send(gnrc_pktsnip_t *buf, tftp_context_t *ctxt, size_t len);
 
 /* decode the default TFTP start packet */
-static int _tftp_decode_start(tftp_context_t *ctxt, uint8_t *buf, gnrc_pktsnip_t *outbuf);
+static int _tftp_decode_start(tftp_context_t *ctxt, uint8_t *buf, size_t len, gnrc_pktsnip_t *outbuf);
</pre>
<p>I would rather change the function to</p>
<pre><code>static int _tftp_decode_start(tftp_context_t *ctxt, uint8_t *buf,  gnrc_pktsnip_t *inpkt, gnrc_pktsnip_t *outbuf);
</code></pre>
<p>and in that function have</p>
<pre><code>size_t len = inpkt->len
uint8_t *buf = inpkt->buf
</code></pre>
<p>what do you think?</p>

<hr>

<p>In <a href="https://github.com/RIOT-OS/RIOT/pull/11737#discussion_r297172830">sys/net/gnrc/application_layer/tftp/gnrc_tftp.c</a>:</p>
<pre style='color:#555'>> @@ -1047,6 +1047,9 @@ int _tftp_decode_start(tftp_context_t *ctxt, uint8_t *buf, gnrc_pktsnip_t *outbu
 
     /* decode the TFTP transfer mode */
     for (uint32_t idx = 0; idx < ARRAY_LEN(_tftp_modes); ++idx) {
+        if (_tftp_modes[idx].len > (len - sizeof(*hdr) - fnlen))
</pre>
<p>coding style requires braces even for one-line <code>if</code>s</p>

<hr>

<p>In <a href="https://github.com/RIOT-OS/RIOT/pull/11737#discussion_r297173506">sys/net/gnrc/application_layer/tftp/gnrc_tftp.c</a>:</p>
<pre style='color:#555'>> @@ -233,7 +233,7 @@ static tftp_state _tftp_send_error(tftp_context_t *ctxt, gnrc_pktsnip_t *buf, tf
 static tftp_state _tftp_send(gnrc_pktsnip_t *buf, tftp_context_t *ctxt, size_t len);
 
 /* decode the default TFTP start packet */
-static int _tftp_decode_start(tftp_context_t *ctxt, uint8_t *buf, gnrc_pktsnip_t *outbuf);
+static int _tftp_decode_start(tftp_context_t *ctxt, uint8_t *buf, size_t len, gnrc_pktsnip_t *outbuf);
</pre>
<p>or instead of the latter cast directly</p>
<pre><code>tftp_header_t *hdr = (tftp_header_t *)inpkt->buf;
</code></pre>

<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/11737?email_source=notifications&email_token=ABE7WYBUUDZ5AMD6L462O43P4IJDDA5CNFSM4H3A2IM2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOB4RXWJY#pullrequestreview-253983527">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABE7WYER6OJ7DHSYHZ7O36DP4IJDDANCNFSM4H3A2IMQ">mute the thread</a>.<img src="https://github.com/notifications/beacon/ABE7WYDH6GBA6M4TBR7KO6LP4IJDDA5CNFSM4H3A2IM2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOB4RXWJY.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/11737?email_source=notifications\u0026email_token=ABE7WYBUUDZ5AMD6L462O43P4IJDDA5CNFSM4H3A2IM2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOB4RXWJY#pullrequestreview-253983527",
"url": "https://github.com/RIOT-OS/RIOT/pull/11737?email_source=notifications\u0026email_token=ABE7WYBUUDZ5AMD6L462O43P4IJDDA5CNFSM4H3A2IM2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOB4RXWJY#pullrequestreview-253983527",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>