summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/changelog7
-rw-r--r--debian/patches/0210_Correct_segfault_on_backend_escl.patch81
-rw-r--r--debian/patches/series1
3 files changed, 89 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog
index 94a5270..5de080b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+sane-backends (1.4.0-2) UNRELEASED; urgency=medium
+
+ * New debian/patches/0210_Correct_segfault_on_backend_escl.patch:
+ - Correct segfault when declaring a new device (Closes: #1118476).
+
+ -- Jörg Frings-Fürst <debian@jff.email> Sat, 25 Oct 2025 18:52:14 +0200
+
sane-backends (1.4.0-1) unstable; urgency=medium
* New upstream release.
diff --git a/debian/patches/0210_Correct_segfault_on_backend_escl.patch b/debian/patches/0210_Correct_segfault_on_backend_escl.patch
new file mode 100644
index 0000000..3d42bc6
--- /dev/null
+++ b/debian/patches/0210_Correct_segfault_on_backend_escl.patch
@@ -0,0 +1,81 @@
+Description: 'fix-declare-device'
+Author: <name and email of author, optional>
+Origin: upstream, https://gitlab.com/sane-project/backends/-/commit/a717ed74c7614b2de5b8486efba75b3442b2558b
+Bug: https://gitlab.com/sane-project/backends/-/issues/826
+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1118476
+Forwarded: not-needed
+Last-Update: 2025-10-25
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+Index: trunk/backend/escl/escl.c
+===================================================================
+--- trunk.orig/backend/escl/escl.c
++++ trunk/backend/escl/escl.c
+@@ -476,6 +476,7 @@ attach_one_config(SANEI_Config __sane_un
+ int port = 0;
+ SANE_Status status;
+ static ESCL_Device *escl_device = NULL;
++ DBG (10, "attach_one_config [%s]\n", line);
+ if (*line == '#') return SANE_STATUS_GOOD;
+ if (!strncmp(line, "pdfblacklist", 12)) return SANE_STATUS_GOOD;
+ if (strncmp(line, "device", 6) == 0) {
+@@ -518,6 +519,7 @@ attach_one_config(SANEI_Config __sane_un
+ }
+
+ if (strncmp(line, "[device]", 8) == 0) {
++ DBG (10, "New Escl_Device");
+ escl_device = escl_free_device(escl_device);
+ escl_device = (ESCL_Device*)calloc(1, sizeof(ESCL_Device));
+ if (!escl_device) {
+@@ -527,26 +529,27 @@ attach_one_config(SANEI_Config __sane_un
+ }
+ else if (strncmp(line, "ip", 2) == 0) {
+ const char *ip_space = sanei_config_skip_whitespace(line + 2);
+- DBG (10, "New Escl_Device IP [%s].", (ip_space ? ip_space : "VIDE"));
+ if (escl_device != NULL && ip_space != NULL) {
++ DBG (10, "New Escl_Device IP [%s].", (ip_space ? ip_space : "VIDE"));
+ DBG (10, "New Escl_Device IP Affected.");
+ escl_device->ip_address = strdup(ip_space);
+ }
+ }
+ else if (sscanf(line, "port %i", &port) == 1 && port != 0) {
+- DBG (10, "New Escl_Device PORT [%d].", port);
+ if (escl_device != NULL) {
++ DBG (10, "New Escl_Device PORT [%d].", port);
+ DBG (10, "New Escl_Device PORT Affected.");
+ escl_device->port_nb = port;
+ }
+ }
+ else if (strncmp(line, "model", 5) == 0) {
+ const char *model_space = sanei_config_skip_whitespace(line + 5);
+- DBG (10, "New Escl_Device MODEL [%s].", (model_space ? model_space : "VIDE"));
+ if (escl_device != NULL && model_space != NULL) {
++ DBG (10, "New Escl_Device MODEL [%s].", (model_space ? model_space : "VIDE"));
+ DBG (10, "New Escl_Device MODEL Affected.");
+ escl_device->model_name = strdup(model_space);
+ }
++ return SANE_STATUS_GOOD;
+ }
+ else if (strncmp(line, "type", 4) == 0) {
+ const char *type_space = sanei_config_skip_whitespace(line + 4);
+@@ -555,6 +558,7 @@ attach_one_config(SANEI_Config __sane_un
+ DBG (10, "New Escl_Device TYPE Affected.");
+ escl_device->type = strdup(type_space);
+ }
++ return SANE_STATUS_GOOD;
+ }
+ escl_device->is = strdup("flatbed or ADF scanner");
+ escl_device->uuid = NULL;
+@@ -562,8 +566,10 @@ attach_one_config(SANEI_Config __sane_un
+ snprintf(url_port, sizeof(url_port), "https://%s:%d", escl_device->ip_address, escl_device->port_nb);
+ escl_device->tls = escl_is_tls(url_port, escl_device->type);
+ status = escl_check_and_add_device(escl_device);
+- if (status == SANE_STATUS_GOOD)
+- escl_device = NULL;
++ if (status == SANE_STATUS_GOOD) {
++ DBG (10, "attach_one_config finish %s://%s:%d", escl_device->type, escl_device->ip_address, escl_device->port_nb);
++ escl_device = NULL;
++ }
+ return status;
+ }
+
diff --git a/debian/patches/series b/debian/patches/series
index 5eb4472..c5f7620 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
+0210_Correct_segfault_on_backend_escl.patch
0040-remove_git.patch
0100-source_spelling.patch
0125-multiarch_dll_search_path.patch