From 65826b186226e3f729b9bd0220777913ef8a67ec Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Fri, 2 Jul 2010 09:49:45 -0700 Subject: [PATCH] Fix nuisance _FORTIFY_SOURCE failures Fix a couple of _FORTIFY_SOURCE failures which are nuisance warnings, but fortunately not too hard to just plain avoid. Signed-off-by: H. Peter Anvin --- mtools/syslinux.c | 6 ++++-- utils/isohybrid.c | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/mtools/syslinux.c b/mtools/syslinux.c index f5b89c9..97286c4 100644 --- a/mtools/syslinux.c +++ b/mtools/syslinux.c @@ -246,7 +246,8 @@ int main(int argc, char *argv[]) syslinux_reset_adv(syslinux_adv); /* This command may fail legitimately */ - system("mattrib -h -r -s s:/ldlinux.sys 2>/dev/null"); + status = system("mattrib -h -r -s s:/ldlinux.sys 2>/dev/null"); + (void)status; /* Keep _FORTIFY_SOURCE happy */ mtp = popen("mcopy -D o -D O -o - s:/ldlinux.sys", "w"); if (!mtp || @@ -323,7 +324,8 @@ int main(int argc, char *argv[]) /* This command may fail legitimately */ sprintf(command, "mattrib -h -r -s %s 2>/dev/null", target_file); - system(command); + status = system(command); + (void)status; /* Keep _FORTIFY_SOURCE happy */ sprintf(command, "mmove -D o -D O s:/ldlinux.sys %s", target_file); status = system(command); diff --git a/utils/isohybrid.c b/utils/isohybrid.c index 38257f6..57c1015 100644 --- a/utils/isohybrid.c +++ b/utils/isohybrid.c @@ -514,7 +514,9 @@ main(int argc, char *argv[]) if (fseek(fp, 440, SEEK_SET)) err(1, "%s: seek error - 4", argv[0]); - fread(&id, 4, 1, fp); + if (fread(&id, 1, 4, fp) != 4) + err(1, "%s: read error", argv[0]); + id = lendian_int(id); if (!id) { -- 2.7.4