mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2025-11-15 07:38:12 +00:00
usb: Annotate access to USB buffers
Annotate the USB transfer creation functions with the correct buffer access attribute. Note that we only annotate them as read_only as the functions may be used for sending and receiving. Hopefully this will catch buffer overflows in drivers in the future.
This commit is contained in:
@@ -37,3 +37,9 @@ typedef struct _FpDeviceClass FpDeviceClass;
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FpDeviceClass, g_type_class_unref);
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GDate, g_date_free);
|
||||
#endif
|
||||
|
||||
#if __GNUC__ > 10 || (__GNUC__ == 10 && __GNUC_MINOR__ >= 1)
|
||||
#define FP_GNUC_ACCESS(m, p, s) __attribute__((access (m, p, s)))
|
||||
#else
|
||||
#define FP_GNUC_ACCESS(m, p, s)
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user