From 574885ad0b8ec93c0dbed59b3f42e047360a8e287c55109204873a69d92685dc Mon Sep 17 00:00:00 2001 From: Steffen Winterfeldt Date: Thu, 9 Jun 2011 09:33:38 +0000 Subject: [PATCH] - fix isohybrid option parsing (bnc #697389) OBS-URL: https://build.opensuse.org/package/show/system:install:head/syslinux?expand=0&rev=31 --- ...nux-4.04-isohybrid-hex-option-parsing.diff | 56 +++++++++++++++++++ syslinux.changes | 5 ++ syslinux.spec | 2 + 3 files changed, 63 insertions(+) create mode 100644 syslinux-4.04-isohybrid-hex-option-parsing.diff diff --git a/syslinux-4.04-isohybrid-hex-option-parsing.diff b/syslinux-4.04-isohybrid-hex-option-parsing.diff new file mode 100644 index 0000000..dbaa3db --- /dev/null +++ b/syslinux-4.04-isohybrid-hex-option-parsing.diff @@ -0,0 +1,56 @@ +diff --git a/utils/isohybrid.c b/utils/isohybrid.c +index 7ee9a7f..e6c50ef 100644 +--- a/utils/isohybrid.c ++++ b/utils/isohybrid.c +@@ -135,32 +135,32 @@ check_option(int argc, char *argv[]) + switch (n) + { + case 'h': +- if (!sscanf(optarg, "%hu", &head) || head < 1 || head > 256) ++ if (!sscanf(optarg, "%hi", &head) || head < 1 || head > 256) + errx(1, "invalid head: `%s', 1 <= head <= 256", optarg); + break; + + case 's': +- if (!sscanf(optarg, "%hhu", §or) || sector < 1 || sector > 63) ++ if (!sscanf(optarg, "%hhi", §or) || sector < 1 || sector > 63) + errx(1, "invalid sector: `%s', 1 <= sector <= 63", optarg); + break; + + case 'e': +- if (!sscanf(optarg, "%hhu", &entry) || entry < 1 || entry > 4) ++ if (!sscanf(optarg, "%hhi", &entry) || entry < 1 || entry > 4) + errx(1, "invalid entry: `%s', 1 <= entry <= 4", optarg); + break; + + case 'o': +- if (!sscanf(optarg, "%hhu", &offset) || offset > 64) ++ if (!sscanf(optarg, "%hhi", &offset) || offset > 64) + errx(1, "invalid offset: `%s', 0 <= offset <= 64", optarg); + break; + + case 't': +- if (!sscanf(optarg, "%hu", &type) || type > 255) ++ if (!sscanf(optarg, "%hi", &type) || type > 255) + errx(1, "invalid type: `%s', 0 <= type <= 255", optarg); + break; + + case 'i': +- if (!sscanf(optarg, "%u", &id)) ++ if (!sscanf(optarg, "%i", &id)) + errx(1, "invalid id: `%s'", optarg); + break; + +diff --git a/utils/isohybrid.h b/utils/isohybrid.h +index 826e90c..eecf1ca 100644 +--- a/utils/isohybrid.h ++++ b/utils/isohybrid.h +@@ -20,7 +20,7 @@ + * + */ + +-#define VERSION "0.11" ++#define VERSION "0.12" + #define BUFSIZE 2048 + #define MBRSIZE 432 + diff --git a/syslinux.changes b/syslinux.changes index d490502..4db7ddc 100644 --- a/syslinux.changes +++ b/syslinux.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Jun 9 11:32:40 CEST 2011 - snwint@suse.de + +- fix isohybrid option parsing (bnc #697389) + ------------------------------------------------------------------- Wed Apr 20 11:27:23 CEST 2011 - snwint@suse.de diff --git a/syslinux.spec b/syslinux.spec index 59a4be8..0b5c21f 100644 --- a/syslinux.spec +++ b/syslinux.spec @@ -35,6 +35,7 @@ Patch0: %{name}-%{version}-iso9660.diff Patch1: %{name}-%{version}-cwd.diff Patch2: %{name}-%{version}-noinitrd.diff Patch3: %{name}-%{version}-mboot_bootif.diff +Patch4: %{name}-%{version}-isohybrid-hex-option-parsing.diff BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -55,6 +56,7 @@ Authors: %patch1 -p1 %patch2 -p1 %patch3 -p1 +%patch4 -p1 %build cp %{SOURCE2} .