From 4e366b34315581b01e58bc12eb645c0171e2a92f Mon Sep 17 00:00:00 2001 From: Stuart D. Gathman Date: Aug 23 2016 17:17:12 +0000 Subject: Fix another null ptr bug --- diff --git a/pgadmin3-nullthis.patch b/pgadmin3-nullthis.patch index d051741..e29635b 100644 --- a/pgadmin3-nullthis.patch +++ b/pgadmin3-nullthis.patch @@ -1,7 +1,19 @@ 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() +--- ./pgadmin/db/pgConn.cpp.nullthis 2016-02-08 05:19:40.000000000 -0500 ++++ ./pgadmin/db/pgConn.cpp 2016-08-23 13:12:34.390480484 -0400 +@@ -648,6 +648,11 @@ void pgConn::ExamineLibpqVersion() + } + } + ++int pgConn::GetPort() const ++{ ++ return conn ? atoi(PQport(conn)) : 0; ++} ++ + wxString pgConn::GetName() const + { + wxString str; +@@ -1003,15 +1008,15 @@ bool pgConn::IsAlive() } @@ -23,9 +35,21 @@ diff -up ./pgadmin/db/pgConn.cpp.nullthis ./pgadmin/db/pgConn.cpp 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: +--- ./pgadmin/include/db/pgConn.h.nullthis 2016-02-08 05:19:40.000000000 -0500 ++++ ./pgadmin/include/db/pgConn.h 2016-08-23 13:11:14.588564870 -0400 +@@ -194,10 +194,7 @@ public: + { + return utfConnectString; + } +- int GetPort() const +- { +- return atoi(PQport(conn)); +- }; ++ int GetPort() const; + wxString GetTTY() const + { + return wxString(PQtty(conn), *conv); +@@ -215,7 +212,11 @@ public: { return PQbackendPID(conn); } diff --git a/pgadmin3.spec b/pgadmin3.spec index 758cfe5..4a0f23c 100644 --- a/pgadmin3.spec +++ b/pgadmin3.spec @@ -1,7 +1,7 @@ Summary: Graphical client for PostgreSQL Name: pgadmin3 Version: 1.22.1 -Release: 2%{?dist} +Release: 3%{?dist} License: PostgreSQL Group: Applications/Databases Source: http://download.postgresql.org/pub/pgadmin3/release/v%{version}/src/%{name}-%{version}.tar.gz @@ -37,7 +37,7 @@ required to communicate with the database server. %setup -q %patch0 -p1 %patch2 -p0 -#patch3 -p1 -b .nullthis +%patch3 -p1 -b .nullthis %build export LIBS="-lwx_gtk2u_core-2.8" @@ -87,6 +87,9 @@ rm -rf %{buildroot} %{_datadir}/applications/* %changelog +* Fri Jul 19 2016 Stuart Gathman 1.22.1-3 +- Fix a few of the null pointer problems, bz#1369520 + * Fri Jul 19 2016 Stuart Gathman 1.22.1-2 - Compile with --no-delete-null-pointer-checks, bz#1335043