From 3059b1a9e859f54bbfab68f88a2e9fcd72dcbe2c Mon Sep 17 00:00:00 2001 From: Mark Cave-Ayland Date: Sun, 5 Feb 2012 00:30:28 +0000 Subject: [PATCH] Fix for #1540: Fix segfault in shp2pgsql-gui when no port is specified. Prevent dereferencing a NULL pointer if the string is empty. git-svn-id: http://svn.osgeo.org/postgis/trunk@9032 b70326c6-7e19-0410-871a-916f4a2858ee --- loader/shp2pgsql-gui.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/loader/shp2pgsql-gui.c b/loader/shp2pgsql-gui.c index aff28ff7a..92482dfd7 100644 --- a/loader/shp2pgsql-gui.c +++ b/loader/shp2pgsql-gui.c @@ -2455,7 +2455,7 @@ pgui_validate_connection() { int i; - if (strlen(conn->port)) + if (conn->port && strlen(conn->port)) { for (i = 0; i < strlen(conn->port); i++) { -- 2.40.0