Add CodeQL for GitHub code scanning (#1548)

* Create codeql.yml

* Addressing codeql findings
This commit is contained in:
LordGrey
2022-12-27 08:36:10 +01:00
committed by GitHub
parent 1189f86c1a
commit 6fa7bab6f7
83 changed files with 1984 additions and 2094 deletions

View File

@@ -63,7 +63,9 @@ bool LedDeviceHyperionUsbasp::init(const QJsonObject &deviceConfig)
else
{
Debug(_log, "USB context initialized");
//libusb_set_debug(_libusbContext, 3);
#if 0
libusb_set_debug(_libusbContext, 3);
#endif
// retrieve the list of USB devices
libusb_device ** deviceList;

View File

@@ -331,8 +331,6 @@ const QString &LedDeviceLightpack::getSerialNumber() const
int LedDeviceLightpack::writeBytes(uint8_t *data, int size)
{
int rc = 0;
//Debug( _log, "[%s]", QSTRING_CSTR(uint8_t_to_hex_string(data, size, 32)) );
int error = libusb_control_transfer(_deviceHandle,
static_cast<uint8_t>( LIBUSB_ENDPOINT_OUT | LIBUSB_REQUEST_TYPE_CLASS | LIBUSB_RECIPIENT_INTERFACE ),
0x09,

View File

@@ -73,8 +73,8 @@ int ProviderHID::open()
// Failed to open the device
this->setInError( "Failed to open HID device. Maybe your PID/VID setting is wrong? Make sure to add a udev rule/use sudo." );
#if 0
// http://www.signal11.us/oss/hidapi/
/*
std::cout << "Showing a list of all available HID devices:" << std::endl;
auto devs = hid_enumerate(0x00, 0x00);
auto cur_dev = devs;
@@ -88,7 +88,8 @@ int ProviderHID::open()
cur_dev = cur_dev->next;
}
hid_free_enumeration(devs);
*/
#endif
}
else
{