[cmake-developers] [CMake 0015367]: cmake crash in GetNumberOfFilesInDirectory

Mantis Bug Tracker mantis at public.kitware.com
Thu Jan 22 23:04:43 EST 2015


The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=15367 
====================================================================== 
Reported By:                Thomas Klausner
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   15367
Category:                   CMake
Reproducibility:            sometimes
Severity:                   crash
Priority:                   high
Status:                     new
====================================================================== 
Date Submitted:             2015-01-22 23:04 EST
Last Modified:              2015-01-22 23:04 EST
====================================================================== 
Summary:                    cmake crash in GetNumberOfFilesInDirectory
Description: 
In Source/kwsys/Directory.cxx, the result value of opendir() is not checked,
which can lead to readdir being called with a NULL pointer as first argument,
which, at least on NetBSD, leads to a segfault.

Steps to Reproduce: 
I don't know how to cause this, but it happened to me in parallel builds on a
tmpfs e.g. when building wesnoth.

Additional Information: 
The attached patch returns '0' as count for directories when opendir fails,
which makes wesnoth build for me. Perhaps dirp==NULL should be reported, but I
don't know how to best do that, so I'll leave that up to you.
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2015-01-22 23:04 Thomas KlausnerNew Issue                                    
2015-01-22 23:04 Thomas KlausnerFile Added: patch-Source_kwsys_Directory.cxx    
               
======================================================================



More information about the cmake-developers mailing list