Skip Menu |

Subject: Improper _findfirst() usage can cause crashes on 64-bit Windows
_findfirst() has a return type of intptr_t. Code which assigns its
value to a "long" variable, and then passes the result to _findnext(),
can crash on 64-bit Windows where long is 32 bits and pointers are 64

This bug can result in build failures running libecho as follows
(reported by github user egonk):

NMAKE : fatal error U1077: '..\..\util\windows\obj\AMD64\rel\libecho' :
return code '0xc0000005'

This misuse is also present in the opendir()/readdir()/closedir() shims
in util/support/plugins.c.
Subject: git commit

Fix crash in libecho.c on win64 build

Return value of _findfirst is intptr_t; see

[ also fix plugins.c]
Author: egonk <>
Committer: Greg Hudson <>
Commit: 35cb760ab5289b29faebc7ecb4b5d8d0315ceae4
Branch: master
src/util/support/plugins.c | 4 ++--
src/util/windows/libecho.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)