From 19c89b488d63d77973c4d931bbfa1e31ddbce208 Mon Sep 17 00:00:00 2001 From: Stuart D. Gathman Date: Jul 19 2016 14:28:13 +0000 Subject: Fix bz#1335043 --- diff --git a/pgadmin3-nullthis.patch b/pgadmin3-nullthis.patch new file mode 100644 index 0000000..d051741 --- /dev/null +++ b/pgadmin3-nullthis.patch @@ -0,0 +1,40 @@ +diff -up ./pgadmin/db/pgConn.cpp.nullthis ./pgadmin/db/pgConn.cpp +--- ./pgadmin/db/pgConn.cpp.nullthis 2016-07-01 13:18:44.649386521 -0400 ++++ ./pgadmin/db/pgConn.cpp 2016-07-01 13:25:40.815813995 -0400 +@@ -1003,15 +1003,15 @@ bool pgConn::IsAlive() + } + + +-int pgConn::GetStatus() const ++int pgConn::GetStatus(const pgConn *p) + { +- if (!this) ++ if (!p) + return PGCONN_BAD; + +- if (conn) +- ((pgConn *)this)->connStatus = PQstatus(conn); ++ if (p->conn) // FIXME: casting away const ! ++ ((pgConn *)p)->connStatus = PQstatus(p->conn); + +- return connStatus; ++ return p->connStatus; + } + + +diff -up ./pgadmin/include/db/pgConn.h.nullthis ./pgadmin/include/db/pgConn.h +--- ./pgadmin/include/db/pgConn.h.nullthis 2016-07-01 13:18:56.643512630 -0400 ++++ ./pgadmin/include/db/pgConn.h 2016-07-01 13:24:07.339776340 -0400 +@@ -215,7 +215,11 @@ public: + { + return PQbackendPID(conn); + } +- int GetStatus() const; ++ static int GetStatus(const pgConn *); ++ int GetStatus() const ++ { ++ return GetStatus(this); ++ } + int GetLastResultStatus() const + { + return lastResultStatus; diff --git a/pgadmin3.spec b/pgadmin3.spec index 0692bf3..758cfe5 100644 --- a/pgadmin3.spec +++ b/pgadmin3.spec @@ -1,12 +1,16 @@ Summary: Graphical client for PostgreSQL Name: pgadmin3 Version: 1.22.1 -Release: 1%{?dist} +Release: 2%{?dist} License: PostgreSQL Group: Applications/Databases Source: http://download.postgresql.org/pub/pgadmin3/release/v%{version}/src/%{name}-%{version}.tar.gz Patch0: %{name}-1.14.2-cflags.patch Patch2: %{name}-desktop.patch +# Move this == null check to a static function. This works, but I opted +# for the compiler flag since it "fixes" all cases, and pgadmin4 is on the +# way. +Patch3: %{name}-nullthis.patch URL: http://www.pgadmin.org/ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: wxGTK-devel postgresql-devel desktop-file-utils openssl-devel libxml2-devel libxslt-devel @@ -33,9 +37,11 @@ required to communicate with the database server. %setup -q %patch0 -p1 %patch2 -p0 +#patch3 -p1 -b .nullthis %build export LIBS="-lwx_gtk2u_core-2.8" +export CXXFLAGS="%optflags -fno-delete-null-pointer-checks" %configure --disable-debug --disable-dependency-tracking --with-wx-version=2.8 --with-wx=%{_prefix} make %{?_smp_mflags} all @@ -81,6 +87,12 @@ rm -rf %{buildroot} %{_datadir}/applications/* %changelog +* Fri Jul 19 2016 Stuart Gathman 1.22.1-2 +- Compile with --no-delete-null-pointer-checks, bz#1335043 + +* Fri Jul 1 2016 Stuart Gathman 1.22.1-1.3 +- Attempt to mitigate pervasive this == 0 coding error + * Wed Feb 17 2016 Devrim GUNDUZ 1.22.1-1 - Update to 1.22.1 - Update download URL