mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-28 10:10:29 +00:00
* util/grub-mkrescue.c (main): Check that fread succeeded.
This commit is contained in:
1 parent
af1faca3f8
commit
422e6e886c
2 files changed
+16
-2
No files matched your search
@@ -1,3 +1,7 @@
|
|||||||
|
2013-11-29 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
|
* util/grub-mkrescue.c (main): Check that fread succeeded.
|
||||||
|
|
||||||
2013-11-29 Vladimir Serbinenko <phcoder@gmail.com>
|
2013-11-29 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
* conf/Makefile.common: Remove -mexplicit-relocs and
|
* conf/Makefile.common: Remove -mexplicit-relocs and
|
||||||
|
|||||||
+12
-2
@@ -519,7 +519,9 @@ main (int argc, char *argv[])
|
|||||||
if (!bi)
|
if (!bi)
|
||||||
grub_util_error (_("cannot open `%s': %s"), bin,
|
grub_util_error (_("cannot open `%s': %s"), bin,
|
||||||
strerror (errno));
|
strerror (errno));
|
||||||
fread (buf, 1, 512, bi);
|
if (fread (buf, 1, 512, bi) != 512)
|
||||||
|
grub_util_error (_("cannot read `%s': %s"), bin,
|
||||||
|
strerror (errno));
|
||||||
fclose (bi);
|
fclose (bi);
|
||||||
fwrite (buf, 1, 512, sa);
|
fwrite (buf, 1, 512, sa);
|
||||||
|
|
||||||
@@ -729,10 +731,18 @@ main (int argc, char *argv[])
|
|||||||
cdboot = grub_util_path_concat (2, source_dirs[GRUB_INSTALL_PLATFORM_SPARC64_IEEE1275],
|
cdboot = grub_util_path_concat (2, source_dirs[GRUB_INSTALL_PLATFORM_SPARC64_IEEE1275],
|
||||||
"cdboot.img");
|
"cdboot.img");
|
||||||
in = grub_util_fopen (cdboot, "rb");
|
in = grub_util_fopen (cdboot, "rb");
|
||||||
|
if (!in)
|
||||||
|
grub_util_error (_("cannot open `%s': %s"), cdboot,
|
||||||
|
strerror (errno));
|
||||||
out = grub_util_fopen (sysarea_img, "wb");
|
out = grub_util_fopen (sysarea_img, "wb");
|
||||||
|
if (!out)
|
||||||
|
grub_util_error (_("cannot open `%s': %s"), sysarea_img,
|
||||||
|
strerror (errno));
|
||||||
memset (buf, 0, 512);
|
memset (buf, 0, 512);
|
||||||
fwrite (buf, 1, 512, out);
|
fwrite (buf, 1, 512, out);
|
||||||
fread (buf, 1, 512, in);
|
if (fread (buf, 1, 512, in) != 512)
|
||||||
|
grub_util_error (_("cannot read `%s': %s"), cdboot,
|
||||||
|
strerror (errno));
|
||||||
fwrite (buf, 1, 512, out);
|
fwrite (buf, 1, 512, out);
|
||||||
fclose (in);
|
fclose (in);
|
||||||
fclose (out);
|
fclose (out);
|
||||||
|
|||||||
Reference in new issue
Block a user