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:
@@ -20,6 +20,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <gusb.h>
|
||||
#include "fpi-compat.h"
|
||||
#include "fpi-device.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
@@ -115,6 +116,7 @@ void fpi_usb_transfer_fill_bulk (FpiUsbTransfer *transfer,
|
||||
guint8 endpoint,
|
||||
gsize length);
|
||||
|
||||
FP_GNUC_ACCESS (read_only, 3, 4)
|
||||
void fpi_usb_transfer_fill_bulk_full (FpiUsbTransfer *transfer,
|
||||
guint8 endpoint,
|
||||
guint8 *buffer,
|
||||
@@ -134,6 +136,7 @@ void fpi_usb_transfer_fill_interrupt (FpiUsbTransfer *transfer,
|
||||
guint8 endpoint,
|
||||
gsize length);
|
||||
|
||||
FP_GNUC_ACCESS (read_only, 3, 4)
|
||||
void fpi_usb_transfer_fill_interrupt_full (FpiUsbTransfer *transfer,
|
||||
guint8 endpoint,
|
||||
guint8 *buffer,
|
||||
|
||||
Reference in New Issue
Block a user