2017-08-16 15:34:58 +00:00
|
|
|
From bb1eaf9f908130c805db845dfc5fffcaec0d98e4 Mon Sep 17 00:00:00 2001
|
2017-06-16 19:31:32 +00:00
|
|
|
From: Mark Salter <msalter@redhat.com>
|
|
|
|
Date: Tue, 7 Mar 2017 18:26:17 -0500
|
2017-08-16 15:14:30 +00:00
|
|
|
Subject: [PATCH 149/192] Fix malformed tftp packets
|
2017-06-16 19:31:32 +00:00
|
|
|
|
|
|
|
0088-Normalize-slashes-in-tftp-paths.patch collapses multiple contiguous
|
|
|
|
slashes in a filename into one slash in the tftp packet filename field.
|
|
|
|
However, the packet buffer pointer is advanced using the original name.
|
|
|
|
This leaves unitialized data between the name field and the type field
|
|
|
|
leading to tftp errors. Use the length of the normalized name to avoid
|
|
|
|
this.
|
|
|
|
|
|
|
|
Signed-off-by: Mark Salter <msalter@redhat.com>
|
|
|
|
---
|
|
|
|
grub-core/net/tftp.c | 4 ++--
|
|
|
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
|
|
|
|
|
|
diff --git a/grub-core/net/tftp.c b/grub-core/net/tftp.c
|
|
|
|
index 5ca0a96a6..dcd824943 100644
|
|
|
|
--- a/grub-core/net/tftp.c
|
|
|
|
+++ b/grub-core/net/tftp.c
|
|
|
|
@@ -360,8 +360,8 @@ tftp_open (struct grub_file *file, const char *filename)
|
|
|
|
/* Copy and normalize the filename to work-around issues on some tftp
|
|
|
|
servers when file names are being matched for remapping. */
|
|
|
|
grub_normalize_filename (rrq, filename);
|
|
|
|
- rrqlen += grub_strlen (filename) + 1;
|
|
|
|
- rrq += grub_strlen (filename) + 1;
|
|
|
|
+ rrqlen += grub_strlen (rrq) + 1;
|
|
|
|
+ rrq += grub_strlen (rrq) + 1;
|
|
|
|
|
|
|
|
grub_strcpy (rrq, "octet");
|
|
|
|
rrqlen += grub_strlen ("octet") + 1;
|
|
|
|
--
|
2017-08-16 15:14:30 +00:00
|
|
|
2.13.4
|
2017-06-16 19:31:32 +00:00
|
|
|
|