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
bits.

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.
From: ghudson@mit.edu
Subject: git commit

Fix crash in libecho.c on win64 build

Return value of _findfirst is intptr_t; see
https://msdn.microsoft.com/en-us/library/zyzxfzac.aspx

[ghudson@mit.edu: also fix plugins.c]

https://github.com/krb5/krb5/commit/35cb760ab5289b29faebc7ecb4b5d8d0315ceae4
Author: egonk <egonk@users.noreply.github.com>
Committer: Greg Hudson <ghudson@mit.edu>
Commit: 35cb760ab5289b29faebc7ecb4b5d8d0315ceae4
Branch: master
src/util/support/plugins.c | 4 ++--
src/util/windows/libecho.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)