Re: [Mingw-w64-public] Fwd: [vlc-devel] [PATCH] fix lfind errors on windows
Issue here is that referenced object 'unsigned int' has different size to 'size_t' on Windows. Means that function might set only lower 32-bit to something meaningful, and so passing a size_t pointer to it could lead to corrupted value in it. Kai -- ___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
Re: [Mingw-w64-public] Fwd: [vlc-devel] [PATCH] fix lfind errors on windows
Yes I agree with this. Especially because lfind is dynamically linked to msvcrt We didn't into this before on irc but could we add something similar to this in header in mingw64 #define _lfind(a,b,c,d,e) _lfind(a,b,(unsigned int*)c,d,e) Which explicitly casts it to (unsigned int *) Would this solve anything ? Many Thanks Martell On Tue, Nov 4, 2014 at 4:17 PM, Kai Tietz ktiet...@googlemail.com wrote: Issue here is that referenced object 'unsigned int' has different size to 'size_t' on Windows. Means that function might set only lower 32-bit to something meaningful, and so passing a size_t pointer to it could lead to corrupted value in it. Kai -- ___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public -- ___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
Re: [Mingw-w64-public] Fwd: [vlc-devel] [PATCH] fix lfind errors on windows
No, it wouldn't help, as we still have an strict-aliasing issue. And additionally the upper 32-bit of object are containing random values Kai 2014-11-04 17:36 GMT+01:00 Martell Malone martellmal...@gmail.com: Yes I agree with this. Especially because lfind is dynamically linked to msvcrt We didn't into this before on irc but could we add something similar to this in header in mingw64 #define _lfind(a,b,c,d,e) _lfind(a,b,(unsigned int*)c,d,e) Which explicitly casts it to (unsigned int *) Would this solve anything ? Many Thanks Martell On Tue, Nov 4, 2014 at 4:17 PM, Kai Tietz ktiet...@googlemail.com wrote: Issue here is that referenced object 'unsigned int' has different size to 'size_t' on Windows. Means that function might set only lower 32-bit to something meaningful, and so passing a size_t pointer to it could lead to corrupted value in it. Kai -- ___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
Re: [Mingw-w64-public] Fwd: [vlc-devel] [PATCH] fix lfind errors on windows
The definition of the function appears to define num is the number of elements in the table If I am reading this correctly the value of size_t has to be set before calling lfind In this case the upper32 bits are already set to 0. Except in the case where size_t is more than 0x elements in num. :( We wouldn't be dealing with random values but we should have some kind of a warning on the size limitation. To cut to the point what's the best solution here then? Remi is dead set on this being a mingw-w64 issue and not that of vlc. I submitted a patch as you can see but no hack by using #ifdef __MINGW32__ will be accepted by them, I know it's the fault of the Microsoft engineer who decided to ignore the spec. I assume that at the time they were only concerned with i686 and not x86_64 heh Thanks for your time Martell On Tue, Nov 4, 2014 at 4:44 PM, Kai Tietz ktiet...@googlemail.com wrote: No, it wouldn't help, as we still have an strict-aliasing issue. And additionally the upper 32-bit of object are containing random values Kai 2014-11-04 17:36 GMT+01:00 Martell Malone martellmal...@gmail.com: Yes I agree with this. Especially because lfind is dynamically linked to msvcrt We didn't into this before on irc but could we add something similar to this in header in mingw64 #define _lfind(a,b,c,d,e) _lfind(a,b,(unsigned int*)c,d,e) Which explicitly casts it to (unsigned int *) Would this solve anything ? Many Thanks Martell On Tue, Nov 4, 2014 at 4:17 PM, Kai Tietz ktiet...@googlemail.com wrote: Issue here is that referenced object 'unsigned int' has different size to 'size_t' on Windows. Means that function might set only lower 32-bit to something meaningful, and so passing a size_t pointer to it could lead to corrupted value in it. Kai -- ___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public -- ___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public