Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Fixed a bug with File.infoGet() and File.getInfo() methods that sometime... #1
...s caused segfaults
The problem is that the stack-allocated info structure is not being zeroed-out before the call to apr_file_info_get(). That function doesn't seem to zero it out either, and only sets the requested fields. As a result, the string pointers info->fname and info->name can point at random memory locations, which can crash the JVM with a segfault when it attempts to copy the file info fields from the C struct to the Java FileInfo instance in fill_finfo() - specifically, the NewStringUTF() call that copies the fname and name strings.