Minor patch to correct buffer overrun

Chris Sutcliffe <[email protected]>
Newsgroups gmane.comp.gnu.make.windows
Message-ID <[email protected]>
As reported on the MinGW-Users mailing list, there is an issue with
buffer overrun regarding 'MAXPATHLEN'.  MinGW's sys/param.h defines
'MAXPATHLEN' as follows:

#define MAXPATHLEN PATH_MAX

where 'PATH_MAX' is 259.  The issue is that make expects 'MAXPATHLEN'
to be considerably bigger (1024).  To correct for it, I created this
small patch:

--- make.h.orig 2010-07-20 09:12:06 -0400
+++ make.h      2010-08-16 08:50:54 -0400
@@ -130,6 +130,9 @@
 #  define PATH_MAX      MAXPATHLEN
 # endif
 #endif
+#ifdef __MINGW32__
+# undef MAXPATHLEN
+#endif
 #ifndef MAXPATHLEN
 # define MAXPATHLEN 1024
 #endif

Cheers!

Chris

-- 
Chris Sutcliffe
http://emergedesktop.org
http://www.google.com/profiles/ir0nh34d
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.