Fix some more null pointer dereferences
This commit is contained in:
parent
8735071fac
commit
57ffb2ba7a
@ -498,7 +498,7 @@ cressi_leonardo_extract_dives (dc_device_t *abstract, const unsigned char data[]
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (previous && previous != footer + 2) {
|
if (previous && previous != footer + 2) {
|
||||||
ERROR (abstract->context, "Profiles are not continuous (0x%04x 0x%04x 0x%04x).", header, footer, previous);
|
ERROR (context, "Profiles are not continuous (0x%04x 0x%04x 0x%04x).", header, footer, previous);
|
||||||
free (buffer);
|
free (buffer);
|
||||||
return DC_STATUS_DATAFORMAT;
|
return DC_STATUS_DATAFORMAT;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -346,7 +346,7 @@ dc_usbhid_read (dc_usbhid_t *usbhid, void *data, size_t size, size_t *actual)
|
|||||||
|
|
||||||
if (usbhid == NULL) {
|
if (usbhid == NULL) {
|
||||||
status = DC_STATUS_INVALIDARGS;
|
status = DC_STATUS_INVALIDARGS;
|
||||||
goto out;
|
goto out_invalidargs;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(HAVE_LIBUSB) && !defined(__APPLE__)
|
#if defined(HAVE_LIBUSB) && !defined(__APPLE__)
|
||||||
@ -369,6 +369,7 @@ dc_usbhid_read (dc_usbhid_t *usbhid, void *data, size_t size, size_t *actual)
|
|||||||
out:
|
out:
|
||||||
HEXDUMP (usbhid->context, DC_LOGLEVEL_INFO, "Read", (unsigned char *) data, nbytes);
|
HEXDUMP (usbhid->context, DC_LOGLEVEL_INFO, "Read", (unsigned char *) data, nbytes);
|
||||||
|
|
||||||
|
out_invalidargs:
|
||||||
if (actual)
|
if (actual)
|
||||||
*actual = nbytes;
|
*actual = nbytes;
|
||||||
|
|
||||||
@ -387,7 +388,7 @@ dc_usbhid_write (dc_usbhid_t *usbhid, const void *data, size_t size, size_t *act
|
|||||||
|
|
||||||
if (usbhid == NULL) {
|
if (usbhid == NULL) {
|
||||||
status = DC_STATUS_INVALIDARGS;
|
status = DC_STATUS_INVALIDARGS;
|
||||||
goto out;
|
goto out_invalidargs;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(HAVE_LIBUSB) && !defined(__APPLE__)
|
#if defined(HAVE_LIBUSB) && !defined(__APPLE__)
|
||||||
@ -410,6 +411,7 @@ dc_usbhid_write (dc_usbhid_t *usbhid, const void *data, size_t size, size_t *act
|
|||||||
out:
|
out:
|
||||||
HEXDUMP (usbhid->context, DC_LOGLEVEL_INFO, "Write", (unsigned char *) data, nbytes);
|
HEXDUMP (usbhid->context, DC_LOGLEVEL_INFO, "Write", (unsigned char *) data, nbytes);
|
||||||
|
|
||||||
|
out_invalidargs:
|
||||||
if (actual)
|
if (actual)
|
||||||
*actual = nbytes;
|
*actual = nbytes;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user