summaryrefslogtreecommitdiff
path: root/debian/patches/kodakaio.patch
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2014-10-06 14:00:40 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2014-10-06 14:00:40 +0200
commit6e9c41a892ed0e0da326e0278b3221ce3f5713b8 (patch)
tree2e301d871bbeeb44aa57ff9cc070fcf3be484487 /debian/patches/kodakaio.patch
Initial import of sane-backends version 1.0.24-1.2
Diffstat (limited to 'debian/patches/kodakaio.patch')
-rw-r--r--debian/patches/kodakaio.patch63
1 files changed, 63 insertions, 0 deletions
diff --git a/debian/patches/kodakaio.patch b/debian/patches/kodakaio.patch
new file mode 100644
index 0000000..f413a00
--- /dev/null
+++ b/debian/patches/kodakaio.patch
@@ -0,0 +1,63 @@
+Description: Backport of bug fix for kodakaio driver
+ The kodakaio driver in 1.0.24 blows up due to a null pointer
+ dereference when scanning for devices if it doesn't find a
+ device. This is a backport of the fix from 1.0.25git.
+Author: Paul Newall <quandry@ntlworld.com>
+
+--- a/backend/kodakaio.c
++++ b/backend/kodakaio.c
+@@ -2184,6 +2184,7 @@
+ AvahiLookupResultFlags flags,
+ AVAHI_GCC_UNUSED void* userdata) {
+
++ AvahiStringList *vid_pair_list = NULL, *pid_pair_list = NULL;
+ char *pidkey, *pidvalue;
+ char *vidkey, *vidvalue;
+ size_t valuesize;
+@@ -2204,17 +2205,37 @@
+ avahi_address_snprint(a, sizeof(a), address);
+
+ /* Output short for Kodak ESP */
+- DBG(min(10,DBG_AUTO), "%s:%u %s ", a,port,host_name);
+- avahi_string_list_get_pair(avahi_string_list_find(txt, "vid"),
+- &vidkey, &vidvalue, &valuesize);
+- DBG(min(10,DBG_AUTO), "%s=%s ", vidkey, vidvalue);
+- avahi_string_list_get_pair(avahi_string_list_find(txt, "pid"),
+- &pidkey, &pidvalue, &valuesize);
+- DBG(min(10,DBG_AUTO), "%s=%s\n", pidkey, pidvalue);
++ DBG(min(10,DBG_AUTO), "%s:%u %s\n", a,port,host_name);
+
++ vid_pair_list = avahi_string_list_find(txt, "vid");
++ if(vid_pair_list != NULL) {
++ avahi_string_list_get_pair(vid_pair_list, &vidkey, &vidvalue, &valuesize);
++ DBG(min(10,DBG_AUTO), "%s=%s ", vidkey, vidvalue);
++ }
++ else DBG(min(10,DBG_AUTO), "failed to find key vid\n");
++
++ pid_pair_list = avahi_string_list_find(txt, "pid");
++ if(pid_pair_list != NULL) {
++ avahi_string_list_get_pair(pid_pair_list, &pidkey, &pidvalue, &valuesize);
++ DBG(min(10,DBG_AUTO), "%s=%s\n", pidkey, pidvalue);
++ }
++ else DBG(min(10,DBG_AUTO), "failed to find key pid\n");
++
++ if(pid_pair_list != NULL && vid_pair_list != NULL) {
+ ProcessAvahiDevice(name, vidvalue, pidvalue, a);
+- avahi_free(vidkey); avahi_free(vidvalue);
+- avahi_free(pidkey); avahi_free(pidvalue);
++ }
++ else DBG(min(10,DBG_AUTO), "didn't call ProcessAvahiDevice\n");
++
++ if(vid_pair_list != NULL) {
++ avahi_free(vidkey);
++ avahi_free(vidvalue);
++ DBG(min(15,DBG_AUTO), "vidkey and vidvalue freed\n");
++ }
++ if(pid_pair_list != NULL) {
++ avahi_free(pidkey);
++ avahi_free(pidvalue);
++ DBG(min(15,DBG_AUTO), "pidkey and pidvalue freed\n");
++ }
+ }
+ }
+