Explorar o código

hidapi/mac: replace sprintf uses with snprintf.

Reference issues:
-  https://github.com/libusb/hidapi/pull/509
-  https://github.com/libusb/hidapi/pull/511
Ozkan Sezer %!s(int64=2) %!d(string=hai) anos
pai
achega
ae9119c36b
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/hidapi/mac/hid.c

+ 1 - 1
src/hidapi/mac/hid.c

@@ -854,7 +854,7 @@ hid_device * HID_API_EXPORT hid_open_path(const char *path, int bExclusive)
 				
 				/* Create the Run Loop Mode for this device.
 				 printing the reference seems to work. */
-				sprintf(str, "HIDAPI_%p", os_dev);
+				snprintf(str, sizeof(str), "HIDAPI_%p", os_dev);
 				dev->run_loop_mode = 
 				CFStringCreateWithCString(NULL, str, kCFStringEncodingASCII);