mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-20 22:48:22 +00:00
Fix a bug in tftp_read, which may appear when seeking back.
This commit is contained in:
1 parent
3785f597a0
commit
902ee9ccaf
2 files changed
+15
-2
No files matched your search
@@ -1,3 +1,10 @@
|
|||||||
|
2001-10-13 Yoshinori K. Okuji <okuji@gnu.org>
|
||||||
|
|
||||||
|
* netboot/fsys_tftp.c (tftp_read): Move the unused data
|
||||||
|
forwards, only if AMT is more than zero. If AMT is not positive,
|
||||||
|
subtract BUF_READ from SAVED_FILEPOS and set BUF_READ to zero,
|
||||||
|
to skip the whole buffer. Reported by Frank Mehnert.
|
||||||
|
|
||||||
2001-10-13 Yoshinori K. Okuji <okuji@gnu.org>
|
2001-10-13 Yoshinori K. Okuji <okuji@gnu.org>
|
||||||
|
|
||||||
Don't use get_diskinfo_floppy. Reported by Ben Liblit
|
Don't use get_diskinfo_floppy. Reported by Ben Liblit
|
||||||
|
|||||||
+8
-2
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* GRUB -- GRand Unified Bootloader
|
* GRUB -- GRand Unified Bootloader
|
||||||
* Copyright (C) 2000 Free Software Foundation, Inc.
|
* Copyright (C) 2000, 2001 Free Software Foundation, Inc.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -367,7 +367,6 @@ tftp_read (char *addr, int size)
|
|||||||
addr += amt;
|
addr += amt;
|
||||||
filepos += amt;
|
filepos += amt;
|
||||||
ret += amt;
|
ret += amt;
|
||||||
}
|
|
||||||
|
|
||||||
/* If the size of the empty space becomes small, move the unused
|
/* If the size of the empty space becomes small, move the unused
|
||||||
data forwards. */
|
data forwards. */
|
||||||
@@ -377,6 +376,13 @@ tftp_read (char *addr, int size)
|
|||||||
buf_read -= FSYS_BUFLEN / 2;
|
buf_read -= FSYS_BUFLEN / 2;
|
||||||
saved_filepos += FSYS_BUFLEN / 2;
|
saved_filepos += FSYS_BUFLEN / 2;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* Skip the whole buffer. */
|
||||||
|
saved_filepos += buf_read;
|
||||||
|
buf_read = 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* Read the data. */
|
/* Read the data. */
|
||||||
if (! buf_fill (0))
|
if (! buf_fill (0))
|
||||||
|
|||||||
Reference in new issue
Block a user