krb5 commit: Fix crash in libecho.c on win64 build

Greg Hudson ghudson at mit.edu
Mon Aug 10 12:52:45 EDT 2015


https://github.com/krb5/krb5/commit/35cb760ab5289b29faebc7ecb4b5d8d0315ceae4
commit 35cb760ab5289b29faebc7ecb4b5d8d0315ceae4
Author: egonk <egonk at users.noreply.github.com>
Date:   Fri Jul 31 17:16:30 2015 +0200

    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 at mit.edu: also fix plugins.c]
    
    ticket: 8230

 src/util/support/plugins.c |    4 ++--
 src/util/windows/libecho.c |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/util/support/plugins.c b/src/util/support/plugins.c
index 8263909..b0bb2ad 100644
--- a/src/util/support/plugins.c
+++ b/src/util/support/plugins.c
@@ -96,7 +96,7 @@ struct dirent {
 };
 
 typedef struct {
-    long handle;                /* _findfirst/_findnext handle */
+    intptr_t handle;            /* _findfirst/_findnext handle */
     short offset;               /* offset into directory */
     short finished;             /* 1 if there are not more files */
     struct _finddata_t fileinfo;/* from _findfirst/_findnext */
@@ -108,7 +108,7 @@ DIR * opendir(const char *dir)
 {
     DIR *dp;
     char *filespec;
-    long handle;
+    intptr_t handle;
     int index;
 
     filespec = malloc(strlen(dir) + 2 + 1);
diff --git a/src/util/windows/libecho.c b/src/util/windows/libecho.c
index a10eee2..f424624 100644
--- a/src/util/windows/libecho.c
+++ b/src/util/windows/libecho.c
@@ -38,7 +38,7 @@ main(int argc, char *argv[])
 void
 echo_files(char *prefix, char *f)
 {
-    long ff;
+    intptr_t ff;
     struct _finddata_t fdt;
     char *slash;
     char filepath[256];


More information about the cvs-krb5 mailing list