Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - JRock

Pages: [1]
1
Window / Heap buffer overflow in JoystickManager
« on: June 29, 2018, 11:57:27 am »
Hey,

I've been working on a project using sfml and encountered an issue when plugging in a controller.
I am using Xcode and enabled the Address Sanitizer in Diagnostics.

Running any app with a controller plugged in or plugging in a controller at any time while the app is running produces a heap buffer overflow (see attached logs and example code).
The controller I'm using is a Logitech Precision Joystick (https://secure.logitech.com/assets/17241/17241.png), I don't know if the issue happens with other controllers though.

I'm running on macOS 10.13.5 with Xcode 9.4.1 and SFML 2.5.0.

#include <SFML/Graphics.hpp>
#include <iostream>

int main(int, char const**)
{
    sf::RenderWindow window(sf::VideoMode(800, 600), "SFML window");

    while (window.isOpen())
    {
        sf::Event event;
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed) {
                window.close();
            }
        }

        window.clear();
        window.display();
    }

    return EXIT_SUCCESS;
}
 

Pages: [1]