ayufan / steam-deck-tools

(Windows) Steam Deck Tools - Fan, Overlay, Power Control and Steam Controller for Windows
https://steam-deck-tools.ayufan.dev
Other
867 stars 63 forks source link

Bug: potentially referencing out of range buffer #183

Open harveyzhong opened 1 month ago

harveyzhong commented 1 month ago

https://github.com/ayufan/steam-deck-tools/blob/b5be6d9caf5db32f136651a3799be1e5e7bd0378/SteamController/Devices/SteamAction.cs#L249

    internal override bool BeforeUpdate(byte[] buffer)
    {
        if (offset < buffer.Length)
        {
            SetValue((buffer[offset] & mask) != 0);
            return true;
        }
        else
        {
            >>>>>>>>>>SetValue((buffer[offset] & mask) != 0);
            return false;
        }
    }
}