It appears to be that _topendir() in mingwex/dirent.c
has a bug in allocating sufficent memory for holding
enough space to contain a unicode string. This will
lead to crash in further use.
nd = (_TDIR *) malloc (sizeof (_TDIR) + _tcslen
(szFullPath) + _tcslen (SLASH) + _tcslen (SUFFIX));
If using _wopendir() _tcslen() is set to wcslen() which
returns the number of characters in the string not the
number of bytes needed to hold the characters.
When replacing it with this code:
nd = (_TDIR *) malloc (sizeof (_TDIR) + (_tcslen
(szFullPath) + _tcslen (SLASH) + _tcslen
everything runs fine.
Accomplished as attachment you find my patch together
with a changelog entry.
Hope you can apply my patches.