* grub-core/net/tftp.c (tftp_receive): Silently discard too short
packets rather than raising an error.
This commit is contained in:
parent
59bfe502c9
commit
0cf69874ee
2 changed files with 14 additions and 5 deletions
|
@ -1,3 +1,8 @@
|
|||
2012-02-12 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/net/tftp.c (tftp_receive): Silently discard too short
|
||||
packets rather than raising an error.
|
||||
|
||||
2012-02-12 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/loader/xnu.c (grub_xnu_writetree_toheap_real): Avoid set
|
||||
|
|
|
@ -160,7 +160,10 @@ tftp_receive (grub_net_udp_socket_t sock __attribute__ ((unused)),
|
|||
grub_uint8_t *ptr;
|
||||
|
||||
if (nb->tail - nb->data < (grub_ssize_t) sizeof (tftph->opcode))
|
||||
return grub_error (GRUB_ERR_OUT_OF_RANGE, "TFTP packet too small");
|
||||
{
|
||||
grub_dprintf ("tftp", "TFTP packet too small\n");
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
|
||||
tftph = (struct tftphdr *) nb->data;
|
||||
switch (grub_be_to_cpu16 (tftph->opcode))
|
||||
|
@ -184,16 +187,17 @@ tftp_receive (grub_net_udp_socket_t sock __attribute__ ((unused)),
|
|||
grub_netbuff_free (nb);
|
||||
err = ack (data->sock, 0);
|
||||
grub_error_save (&data->save_err);
|
||||
if (err)
|
||||
return err;
|
||||
return GRUB_ERR_NONE;
|
||||
case TFTP_DATA:
|
||||
if (nb->tail - nb->data < (grub_ssize_t) (sizeof (tftph->opcode)
|
||||
+ sizeof (tftph->u.data.block)))
|
||||
return grub_error (GRUB_ERR_OUT_OF_RANGE, "TFTP packet too small");
|
||||
{
|
||||
grub_dprintf ("tftp", "TFTP packet too small\n");
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
err = ack (data->sock, tftph->u.data.block);
|
||||
if (err)
|
||||
return err;
|
||||
return err;
|
||||
|
||||
err = grub_priority_queue_push (data->pq, &nb);
|
||||
if (err)
|
||||
|
|
Loading…
Reference in a new issue