From 7ba5478f32bcdbc90e4b3eacd03c5add6d10f986 Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Mon, 13 Dec 2010 16:54:46 +0000 Subject: [PATCH] Prevent hpaio segfaulting on invalid URIs (bug #649092). --- hplip-hpaio-segfault.patch | 11 +++++++++++ hplip.spec | 5 +++++ 2 files changed, 16 insertions(+) create mode 100644 hplip-hpaio-segfault.patch diff --git a/hplip-hpaio-segfault.patch b/hplip-hpaio-segfault.patch new file mode 100644 index 0000000..936c5d0 --- /dev/null +++ b/hplip-hpaio-segfault.patch @@ -0,0 +1,11 @@ +diff -up hplip-3.10.9/io/hpmud/hpmud.c.hpaio-segfault hplip-3.10.9/io/hpmud/hpmud.c +--- hplip-3.10.9/io/hpmud/hpmud.c.hpaio-segfault 2010-12-13 16:53:16.470306314 +0000 ++++ hplip-3.10.9/io/hpmud/hpmud.c 2010-12-13 16:53:17.423332321 +0000 +@@ -305,6 +305,7 @@ static int new_device(const char *uri, e + { + BUG("invalid uri %s\n", uri); + *result = HPMUD_R_INVALID_URI; ++ index = 0; + goto bugout; + } + msp->device[i].io_mode = mode; diff --git a/hplip.spec b/hplip.spec index fb0924a..83e9a0d 100644 --- a/hplip.spec +++ b/hplip.spec @@ -44,6 +44,7 @@ Patch27: hplip-emit-SIGNAL.patch Patch28: hplip-fab-root-crash.patch Patch29: hplip-addprinter.patch Patch30: hplip-dbus-exception.patch +Patch31: hplip-hpaio-segfault.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -276,6 +277,9 @@ done # Catch D-Bus exceptions in fax dialog (bug #645316). %patch30 -p1 -b .dbus-exception +# Prevent hpaio segfaulting on invalid URIs (bug #649092). +%patch31 -p1 -b .hpaio-segfault + sed -i.duplex-constraints \ -e 's,\(UIConstraints.* \*Duplex\),//\1,' \ prnt/drv/hpcups.drv.in @@ -503,6 +507,7 @@ fi %changelog * Mon Dec 13 2010 Tim Waugh - 3.10.9-9 +- Prevent hpaio segfaulting on invalid URIs (bug #649092). - Catch D-Bus exceptions in fax dialog (bug #645316). * Fri Dec 03 2010 Jiri Popelka 3.10.9-8