From 17ef14c91669b1c7a8c32f106148c142a488a9c4 Mon Sep 17 00:00:00 2001 From: "Manoel R. Abranches" Date: Thu, 29 Jul 2010 18:13:00 -0300 Subject: [PATCH] Process errot packets in TFTP reply. --- net/tftp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/net/tftp.c b/net/tftp.c index dff0f134c..0fb43105d 100644 --- a/net/tftp.c +++ b/net/tftp.c @@ -140,7 +140,7 @@ tftp_receive (struct grub_net_network_layer_interface *inf __attribute((unused)) } //buff_clean - nb->data = nb->tail; + grub_netbuff_clear(nb); // grub_printf("OACK---------------------------------------------------------\n"); //grub_printf("block_size=%d\n",tftp_file.block_size); // grub_printf("file_size=%d\n",tftp_file.size); @@ -155,7 +155,8 @@ tftp_receive (struct grub_net_network_layer_interface *inf __attribute((unused)) grub_netbuff_clear(nb); break; case TFTP_ERROR: - nb->data = nb->tail; + grub_netbuff_clear (nb); + return grub_error (GRUB_ERR_ACCESS_DENIED, (char *)tftph->u.err.errmsg); break; }