Skip to content

Commit

Permalink
Merge branch '2019.07-branch' into backport/2019.07/pr_fix_issue_11626
Browse files Browse the repository at this point in the history
  • Loading branch information
fjmolinas authored Jul 17, 2019
2 parents d8774d0 + e6cb9d3 commit d8be0bc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sys/net/gnrc/application_layer/tftp/gnrc_tftp.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ static kernel_pid_t _tftp_kernel_pid;

#define TFTP_TIMEOUT_MSG 0x4000
#define TFTP_STOP_SERVER_MSG 0x4001
#define TFTP_MIN_PACKET_LEN 4
#define TFTP_DEFAULT_DATA_SIZE (GNRC_TFTP_MAX_TRANSFER_UNIT \
+ sizeof(tftp_packet_data_t))

Expand Down Expand Up @@ -607,6 +608,11 @@ tftp_state _tftp_state_processes(tftp_context_t *ctxt, msg_t *m)
}

gnrc_pktsnip_t *pkt = m->content.ptr;
if (pkt->size < TFTP_MIN_PACKET_LEN) {
DEBUG("tftp: packet is too short\n");
gnrc_pktbuf_release(outbuf);
return TS_FAILED;
}

gnrc_pktsnip_t *tmp;
tmp = gnrc_pktsnip_search_type(pkt, GNRC_NETTYPE_UDP);
Expand Down

0 comments on commit d8be0bc

Please sign in to comment.