Skip to content

Fix: Explicit null dereferenced #547

Closed

Description

@Youw

From Coverity: macos/hid.c:

hid_device * HID_API_EXPORT hid_open_path(const char *path)
1021{
    	1. assign_zero: Assigning: dev = NULL.
1022        hid_device *dev = NULL;
1023        io_registry_entry_t entry = MACH_PORT_NULL;
1024        IOReturn ret = kIOReturnInvalid;
1025        char str[32];
1026
1027        /* Set up the HID Manager if it hasn't been done */
    	2. Condition hid_init() < 0, taking true branch.
1028        if (hid_init() < 0) {
    	3. Jumping to label return_error.
1029                goto return_error;
1030        }

return_error:
    	
CID 1530048 (#1 of 1): Explicit null dereferenced (FORWARD_NULL)
4. var_deref_op: Dereferencing null pointer dev.
1088        if (dev->device_handle != NULL)
1089                CFRelease(dev->device_handle);

Activity

  1. added
    bugSomething isn't working
    macOSRelated to macOS backend
    on May 13, 2023
  2. added a commit that references this issue on May 15, 2023
    4eed003
  3. added a commit that references this issue on May 15, 2023
    6e3dd57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingmacOSRelated to macOS backend

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions