This is an automated email from the ASF dual-hosted git repository.

leginee pushed a commit to branch win10-msvc-trunk
in repository https://gitbox.apache.org/repos/asf/openoffice.git

commit e8c1cb88c831d9edf0a8f54757c936b5cd4f7d49
Author: Peter Kovacs <[email protected]>
AuthorDate: Sun Aug 23 00:01:54 2026 +0200

    autodoc: a _findfirst handle is intptr_t, not long
    
    _findfirst returns intptr_t -- 64 bit on x64 -- and Directory::
    GetContainedDirectories/GetContainedFiles stored it in a long, which is 32
    bit on Windows both arches.  The handle lost its high half, so the following
    _findnext dereferenced garbage:
    
        autodoc!csv::ploc::Directory::GetContainedDirectories+0xe5
        ucrtbase!common_find_next_narrow -> KERNELBASE!FindNextFileW -> AV
    
    with rdi = 00000000`56867e48 where live pointers on that heap carried a
    000001f9 prefix.  The x64 build died in odk/pack/copying with SIGSEGV (dmake
    error 139) generating the SDK's IDL reference.
    
    Two sites, and a sweep found no others in the tree.  <io.h> is already
    included, so intptr_t is in scope.
    
    Co-Authored-By: Claude Opus 5 <[email protected]>
    Claude-Session: https://claude.ai/code/session_01VrM7EMKgiuyVcCUe9nSbZR
---
 main/autodoc/source/cosv/storage/ploc_dir.cxx | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/main/autodoc/source/cosv/storage/ploc_dir.cxx 
b/main/autodoc/source/cosv/storage/ploc_dir.cxx
index cde0e23934..61730ac256 100644
--- a/main/autodoc/source/cosv/storage/ploc_dir.cxx
+++ b/main/autodoc/source/cosv/storage/ploc_dir.cxx
@@ -157,7 +157,7 @@ Directory::GetContainedDirectories( StringVector & 
o_rResult ) const
 
        struct _finddata_t
                     aEntry;
-       long            hFile = _findfirst( sFilter.c_str(), &aEntry );
+       intptr_t        hFile = _findfirst( sFilter.c_str(), &aEntry );
 
        for ( int bFindMore = (hFile == -1 ? 1 : 0);
                  bFindMore == 0;
@@ -189,7 +189,7 @@ Directory::GetContainedFiles( StringVector &    o_rResult,
 
        struct _finddata_t
                     aEntry;
-       long            hFile = _findfirst( sFilter.c_str(), &aEntry );
+       intptr_t        hFile = _findfirst( sFilter.c_str(), &aEntry );
        for ( int bFindMore = (hFile == -1 ? 1 : 0);
                  bFindMore == 0;
                  bFindMore = _findnext( hFile, &aEntry ) )

Reply via email to