summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2011-11-17 13:24:55 -0500
committerBruce Momjian <bruce@momjian.us>2011-11-17 13:24:55 -0500
commit379aa2f5a40c8f46911d9979f3222f8c5abc59b0 (patch)
tree463839de25cef1330b45b3395b7695fa46a07a33
parent165fd3947a72eaa576c18db42fa653e17f962280 (diff)
Fix pg_upgrade's pg_scandir_internal() to properly handle a NULL
pattern, which is used on PG 9.1 and HEAD (but not pre-9.1). Fixes crash on Windows. Backpatched to 9.1. Reported by Mark Dilger
-rw-r--r--contrib/pg_upgrade/file.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/contrib/pg_upgrade/file.c b/contrib/pg_upgrade/file.c
index 02c81a7fc4e..4983e7f5ad9 100644
--- a/contrib/pg_upgrade/file.c
+++ b/contrib/pg_upgrade/file.c
@@ -294,7 +294,7 @@ pg_scandir_internal(const char *dirname,
while ((direntry = readdir(dirdesc)) != NULL)
{
/* Invoke the selector function to see if the direntry matches */
- if ((*selector) (direntry))
+ if (selector && (*selector) (direntry))
{
count++;