commit 4c051d2c99954df459397a9f83762f7bad7fbcf0
Author: Nathanael d. Noblet <nathanael(a)noblet.ca>
Date: Thu Feb 19 22:52:10 2015 -0700
fix for bug #1193177
dspam-sqlite3_drv.patch | 51 +++++++++++++++++++++++++++++++++++++++++++++++++
dspam.spec | 7 ++++++-
2 files changed, 57 insertions(+), 1 deletion(-)
---
diff --git a/dspam-sqlite3_drv.patch b/dspam-sqlite3_drv.patch
new file mode 100644
index 0000000..95b6264
--- /dev/null
+++ b/dspam-sqlite3_drv.patch
@@ -0,0 +1,51 @@
+diff -up ./src/sqlite3_drv.c.sdg ./src/sqlite3_drv.c
+--- ./src/sqlite3_drv.c.sdg 2015-02-16 12:18:49.000000000 -0500
++++ ./src/sqlite3_drv.c 2015-02-16 13:28:52.000000000 -0500
+@@ -435,6 +435,13 @@ _ds_setall_spamrecords (DSPAM_CTX * CTX,
+ return EUNKNOWN;
+ }
+
++ if ((sqlite3_exec(s->dbh, "BEGIN", NULL, NULL, NULL)) != SQLITE_OK)
++ {
++ buffer_destroy (query);
++ LOGDEBUG ("_ds_setall_spamrecords: BEGIN transaction failed");
++ return EINVAL;
++ }
++
+ ds_diction_getstat(diction, s->control_token, &control);
+
+ snprintf (queryhead, sizeof (queryhead),
+@@ -521,6 +528,7 @@ _ds_setall_spamrecords (DSPAM_CTX * CTX,
+ LOGDEBUG ("_ds_setall_spamrecords: unable to run query: %s",
query->data);
+ ds_diction_close(ds_c);
+ buffer_destroy(query);
++ sqlite3_exec(s->dbh, "ROLLBACK", NULL, NULL, NULL);
+ return EFAILURE;
+ }
+ }
+@@ -552,11 +560,17 @@ _ds_setall_spamrecords (DSPAM_CTX * CTX,
+ _sqlite_drv_query_error (err, query->data);
+ LOGDEBUG ("_ds_setall_spamrecords: unable to run query: %s",
query->data);
+ buffer_destroy(query);
++ sqlite3_exec(s->dbh, "ROLLBACK", NULL, NULL, NULL);
+ return EFAILURE;
+ }
+ }
+
+ buffer_destroy (query);
++ if ((sqlite3_exec(s->dbh, "COMMIT", NULL, NULL, NULL)) != SQLITE_OK)
++ {
++ LOGDEBUG ("_ds_setall_spamrecords: COMMIT transaction failed");
++ return EINVAL;
++ }
+ return 0;
+ }
+
+@@ -1336,7 +1350,7 @@ _sqlite_drv_query_error (const char *err
+ fclose (file);
+ }
+
+- free((char *)error);
++ sqlite3_free((char *)error);
+ return;
+ }
diff --git a/dspam.spec b/dspam.spec
index 71a1a3e..2da7bb9 100644
--- a/dspam.spec
+++ b/dspam.spec
@@ -12,7 +12,7 @@
Summary: A library and Mail Delivery Agent for Bayesian SPAM filtering
Name: dspam
Version: 3.10.2
-Release: 15%{?dist}
+Release: 16%{?dist}
License: GPLv2
Group: System Environment/Daemons
Source0:
http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
@@ -28,6 +28,7 @@ Patch2: dspam-3.9.0-dspamsock.patch
Patch3: dspam-default-server-port.patch
Patch4: dspam-3.10.2.exim.patch
Patch5: dspam-recipient-corruption.patch
+Patch6: dspam-sqlite3_drv.patch
URL:
http://www.nuclearelephant.com/
# kept to be able to build EPEL versions
@@ -142,6 +143,7 @@ Web-based interface for DSPAM's powerful Anti-Spam engine.
%patch3 -p0
%patch4 -p0
%patch5 -p1
+%patch6 -p0
%build
@@ -371,6 +373,9 @@ exit 0
%config(noreplace) %{_sysconfdir}/httpd/conf.d/dspam-web.conf
%changelog
+* Thu Feb 19 2015 Nathanael Noblet <nathanael(a)gnat.ca> - 3.10.2-16
+- Fix for bug #1193177 - Sqlite3 free
+
* Thu Jan 22 2015 Nathanael Noblet <nathanael(a)gnat.ca> - 3.10.2-15
- Set dspamc suid bits