[Pkg-php-commits] [php/debian-sid] Cherry pick fix for segfault in pgsql_stmt_execute when postgres is down
Ondřej Surý
ondrej at sury.org
Wed Jan 5 10:06:14 UTC 2011
---
...-pgsql_stmt_execute-when-postgres-is-down.patch | 11 +++++++++++
debian/patches/series | 1 +
2 files changed, 12 insertions(+), 0 deletions(-)
create mode 100644 debian/patches/fix-segfault-in-pgsql_stmt_execute-when-postgres-is-down.patch
diff --git a/debian/patches/fix-segfault-in-pgsql_stmt_execute-when-postgres-is-down.patch b/debian/patches/fix-segfault-in-pgsql_stmt_execute-when-postgres-is-down.patch
new file mode 100644
index 0000000..7b424c5
--- /dev/null
+++ b/debian/patches/fix-segfault-in-pgsql_stmt_execute-when-postgres-is-down.patch
@@ -0,0 +1,11 @@
+--- a/ext/pdo_pgsql/pgsql_statement.c
++++ b/ext/pdo_pgsql/pgsql_statement.c
+@@ -184,7 +184,7 @@ stmt_retry:
+ * chance to DEALLOCATE the prepared statements it has created. so, if we hit a 42P05 we
+ * deallocate it and retry ONCE (thies 2005.12.15)
+ */
+- if (!strcmp(sqlstate, "42P05")) {
++ if (sqlstate && !strcmp(sqlstate, "42P05")) {
+ char buf[100]; /* stmt_name == "pdo_crsr_%08x" */
+ PGresult *res;
+ snprintf(buf, sizeof(buf), "DEALLOCATE %s", S->stmt_name);
diff --git a/debian/patches/series b/debian/patches/series
index cf47468..16e2c5d 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -84,3 +84,4 @@ fix-integer-overflow-in-SdnToJulian.patch
fix-leak-and-possible-crash-introduced-by-the-null-poisoning-patch.patch
fix-leaks-and-crash-bug-when-passing-the-callback-as-variable.patch
fix-memory-leak-inside-highlight_string.patch
+fix-segfault-in-pgsql_stmt_execute-when-postgres-is-down.patch
--
1.7.1
More information about the Pkg-php-commits
mailing list