From 5005bca61c8c6b2dea992ec804fc105bc0447521 Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Wed, 14 Jan 2015 15:59:08 -0700 Subject: [PATCH] Add patch to fix command line parsing segfault (bug #1150349) and to fix old style command line options --- freerdp-args.patch | 27 +++++++++++++++++++++++++++ freerdp.spec | 10 +++++++++- 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 freerdp-args.patch diff --git a/freerdp-args.patch b/freerdp-args.patch new file mode 100644 index 0000000..05a61c6 --- /dev/null +++ b/freerdp-args.patch @@ -0,0 +1,27 @@ +diff -up FreeRDP-1.2.0-beta1-android9/client/common/cmdline.c.args FreeRDP-1.2.0-beta1-android9/client/common/cmdline.c +--- FreeRDP-1.2.0-beta1-android9/client/common/cmdline.c.args 2015-01-14 15:53:01.654250627 -0700 ++++ FreeRDP-1.2.0-beta1-android9/client/common/cmdline.c 2015-01-14 15:54:14.634837903 -0700 +@@ -1087,7 +1087,7 @@ BOOL freerdp_client_detect_command_line( + *flags |= COMMAND_LINE_SIGIL_DASH | COMMAND_LINE_SIGIL_DOUBLE_DASH; + *flags |= COMMAND_LINE_SIGIL_ENABLE_DISABLE; + +- if (windows_cli_count >= posix_cli_count) ++ if ((windows_cli_count >= 0) && (windows_cli_count >= posix_cli_count)) + { + *flags = COMMAND_LINE_SEPARATOR_COLON; + *flags |= COMMAND_LINE_SIGIL_SLASH | COMMAND_LINE_SIGIL_PLUS_MINUS; +diff -up FreeRDP-1.2.0-beta1-android9/client/common/compatibility.c.args FreeRDP-1.2.0-beta1-android9/client/common/compatibility.c +--- FreeRDP-1.2.0-beta1-android9/client/common/compatibility.c.args 2014-09-11 16:46:32.000000000 -0600 ++++ FreeRDP-1.2.0-beta1-android9/client/common/compatibility.c 2015-01-14 15:53:01.655250622 -0700 +@@ -262,8 +262,10 @@ int freerdp_client_old_command_line_pre_ + } + + if (p != NULL) +- { + p = strchr(p, ':'); ++ ++ if (p != NULL) ++ { + length = (int) (p - a); + args->argv[j + 1] = (char*) malloc(length + 1); + CopyMemory(args->argv[j + 1], a, length); diff --git a/freerdp.spec b/freerdp.spec index 4ab40fa..2cd7278 100644 --- a/freerdp.spec +++ b/freerdp.spec @@ -1,6 +1,6 @@ Name: freerdp Version: 1.2.0 -Release: 0.4.beta.1%{?dist} +Release: 0.5.beta.1%{?dist} Epoch: 1 Summary: Free implementation of the Remote Desktop Protocol (RDP) @@ -10,6 +10,9 @@ Source0: https://github.com/FreeRDP/FreeRDP/archive/%{version}-beta1+andr Patch0: freerdp-aarch64.patch # https://github.com/FreeRDP/FreeRDP/commit/1b663ceffe51008af7ae9749e5b7999b2f7d6698 Patch1: freerdp-cmake-list.patch +# https://bugzilla.redhat.com/show_bug.cgi?id=1150349 +# https://github.com/FreeRDP/FreeRDP/pull/2305 +Patch2: freerdp-args.patch BuildRequires: alsa-lib-devel BuildRequires: cmake >= 2.8 @@ -90,6 +93,7 @@ developing applications that use %{name}-libwinpr. %setup -qn FreeRDP-%{version}-beta1-android9 %patch0 -p1 -b .aarch64 %patch1 -p1 -b .cmake-list +%patch2 -p1 -b .args # Rpmlint fixes find . -name "*.h" -exec chmod 664 {} \; @@ -183,6 +187,10 @@ find %{buildroot} -name "*.a" -delete %{_libdir}/pkgconfig/winpr.pc %changelog +* Wed Jan 14 2015 Orion Poplawski - 1:1.2.0-0.5.beta.1 +- Add patch to fix command line parsing segfault (bug #1150349) and to + fix old style command line options + * Tue Dec 16 2014 Simone Caronni - 1:1.2.0-0.4.beta.1 - Fix build on CMake 3.1.