mirror of https://github.com/nirenjan/libx52.git
fix: Handle NULL pointer dereferencing in libx52
libx52_exit dereferences the device pointer to deinitialize libusb. However, a user could pass NULL to this function, resulting in a null pointer dereference.pull/60/head
parent
b3dff7182b
commit
f51b777ca0
|
|
@ -12,7 +12,7 @@ lib_LTLIBRARIES += libx52.la
|
|||
# See: https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
|
||||
libx52_v_CUR=6
|
||||
libx52_v_AGE=4
|
||||
libx52_v_REV=1
|
||||
libx52_v_REV=2
|
||||
libx52_la_SOURCES = \
|
||||
libx52/x52_control.c \
|
||||
libx52/x52_core.c \
|
||||
|
|
|
|||
|
|
@ -229,6 +229,10 @@ int libx52_init(libx52_device **dev)
|
|||
|
||||
void libx52_exit(libx52_device *dev)
|
||||
{
|
||||
if (!dev) {
|
||||
return;
|
||||
}
|
||||
|
||||
libx52_disconnect(dev);
|
||||
libusb_exit(dev->ctx);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue