-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[raylib] Buffer Overflow In Initialization #4695
Comments
|
I had this same issue, ran a backtrace with gdb:
So I tried removing the DS4 wireless adapter and sure enough, crash went away. The device name is 74 bytes long, while the field it's entered into is only 64 bytes long. Should be an easy fix, but I'm a noob and have no idea how to upload the changes myself tbh |
thank you asdqwe , it works now!! |
I found the relevant line of code in rcore.c, doubled the buffer size from 64B to 128B and it works. Here's the diff output, sorry I don't know how to contribute via git
|
Ok. I did dive a little deeper, and some more changes needed. In raylib/src/platforms/rcore_desktop_sdl.c Lines 1673 to 1674 in 0275d13
raylib/src/platforms/rcore_desktop_sdl.c Lines 1980 to 1981 in 0275d13
...and then when disconnected 64 bytes are zeroed. raylib/src/platforms/rcore_desktop_sdl.c Lines 1690 to 1691 in 0275d13
In raylib/src/platforms/rcore_desktop_glfw.c Line 1655 in 0275d13
raylib/src/platforms/rcore_desktop_glfw.c Line 1918 in 0275d13
...and again when disconnected 64 bytes are zeroed. raylib/src/platforms/rcore_desktop_glfw.c Line 1922 in 0275d13
Honestly, @raysan5 I don't know what's the best approach here. Should we define something like |
@WyntrHeart Wow! Very good catch! Gamepad name retrieval was added lately...
Yeah, it seems the best solution. Feel free to send a PR! |
I couldn't find anyone with this problem And i tried to see any solution but nothing.
And this issue is not only in raylib, even in raygui.
./program
And This is The Code :
The text was updated successfully, but these errors were encountered: