head 1.3; access; symbols; locks; strict; comment @// @; 1.3 date 2015.02.05.18.20.06; author wiz; state dead; branches; next 1.2; commitid ikKndiUTT9MgEQ8y; 1.2 date 2015.02.05.17.45.22; author adam; state Exp; branches; next 1.1; commitid zEjI1j2yfj45sQ8y; 1.1 date 2015.01.23.04.06.08; author wiz; state Exp; branches; next ; commitid IvM7ZxU1iwxdl67y; desc @@ 1.3 log @Bug was fixed slightly differently upstream, remove unnecessary patch. @ text @$NetBSD: patch-Source_kwsys_Directory.cxx,v 1.2 2015/02/05 17:45:22 adam Exp $ When opendir() fails, readdir() is called with a NULL pointer, leading to a segfault. http://public.kitware.com/Bug/view.php?id=15367 --- Source/kwsys/Directory.cxx.orig 2015-02-04 20:36:44.000000000 +0000 +++ Source/kwsys/Directory.cxx @@@@ -245,11 +245,14 @@@@ unsigned long Directory::GetNumberOfFile } unsigned long count = 0; - for (dirent* d = readdir(dir); d; d = readdir(dir) ) + if (dir) { - count++; + for (dirent* d = readdir(dir); d; d = readdir(dir) ) + { + count++; + } + closedir(dir); } - closedir(dir); return count; } @ 1.2 log @Changes 3.1.2: * install: Fix regression in default configuration selection * CPack: Fix packaging of source tarballs with symbolic links * KWSys Directory: Check opendir return value before using it * Help: Clarify status of link_libraries command * Normalize OBJECT_DEPENDS paths to match custom commands * MSVC: Fix initialization of RelWithDebInfo shared library link flags * FeatureSummary: Fix bracket in documentation. * FindOpenSSL: fix detection of OpenSSL 1.0.2 * ctest_build: Update GNU make error message matching @ text @d1 1 a1 1 $NetBSD: patch-Source_kwsys_Directory.cxx,v 1.1 2015/01/23 04:06:08 wiz Exp $ @ 1.1 log @When opendir() fails, readdir() is called with a NULL pointer, leading to a segfault. Reported at http://public.kitware.com/Bug/view.php?id=15367 Bump PKGREVISION. @ text @d1 1 a1 1 $NetBSD$ d8 1 a8 1 --- Source/kwsys/Directory.cxx.orig 2014-12-15 20:07:43.000000000 +0000 d10 2 a11 2 @@@@ -240,11 +240,14 @@@@ unsigned long Directory::GetNumberOfFile DIR* dir = opendir(name.c_str()); @