trivial: Require <string.h> for strlen() and memcpy()

This commit is contained in:
Richard Hughes 2020-12-14 11:38:18 +00:00
parent 3a0ee309d5
commit a14de30153
16 changed files with 30 additions and 3 deletions

View File

@ -6,6 +6,8 @@
#include "config.h"
#include <string.h>
#include "fwupd-enums-private.h"
#include "fwupd-plugin-private.h"

View File

@ -7,6 +7,7 @@
#include "config.h"
#include <gio/gio.h>
#include <string.h>
#include "fwupd-common-private.h"
#include "fwupd-enums-private.h"

View File

@ -8,6 +8,8 @@
#include "config.h"
#include <string.h>
#include "fu-common.h"
#include "fu-dfu-firmware.h"

View File

@ -6,6 +6,8 @@
#include "config.h"
#include <string.h>
#include "fu-common.h"
#include "fu-fmap-firmware.h"

View File

@ -7,6 +7,8 @@
#include "config.h"
#include <string.h>
#include "fu-common.h"
#include "fu-bcm57xx-common.h"

View File

@ -10,6 +10,7 @@
#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif
#include <string.h>
#include <glib/gstdio.h>
#ifdef HAVE_ETHTOOL_H
#include <linux/ethtool.h>

View File

@ -12,6 +12,7 @@
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
#ifdef HAVE_MMAN_H
#include <sys/mman.h>
#endif

View File

@ -7,6 +7,8 @@
#include "config.h"
#include <string.h>
#include "fu-common.h"
#include "fu-common-version.h"
#include "fu-ccgx-dmc-common.h"

View File

@ -7,6 +7,8 @@
#include "config.h"
#include <string.h>
#include "fu-common.h"
#include "fu-common-version.h"
#include "fu-firmware-common.h"

View File

@ -7,6 +7,8 @@
#include "config.h"
#include <string.h>
#include "fu-chunk.h"
#include "fu-ccgx-common.h"

View File

@ -8,6 +8,7 @@
#include "config.h"
#include <fwupd.h>
#include <string.h>
#include "fu-common.h"
#include "fu-goodixmoc-common.h"

View File

@ -6,6 +6,8 @@
#include "config.h"
#include <string.h>
#include "fu-firmware-common.h"
#include "fu-jabra-device.h"

View File

@ -7,6 +7,8 @@
#include "config.h"
#include <string.h>
#include "fu-common.h"
#include "fu-synaptics-cxaudio-firmware.h"

View File

@ -7,6 +7,7 @@
#include "config.h"
#include <string.h>
#include <gio/gio.h>
#include "fu-common.h"

View File

@ -56,12 +56,15 @@ fu_vli_usbhub_device_i2c_write (FuVliUsbhubDevice *self,
GError **error)
{
GUsbDevice *usb_device = fu_usb_device_get_dev (FU_USB_DEVICE (self));
g_autofree guint8 *buf = g_malloc0 (datasz + 2);
gsize bufsz = datasz + 2;
g_autofree guint8 *buf = g_malloc0 (bufsz);
buf[0] = slave_addr;
buf[1] = sub_addr;
memcpy (buf + 2, data, datasz);
if (!fu_memcpy_safe (buf, bufsz, 0x2, /* dst */
data, datasz, 0x0, /* src */
datasz, error))
return FALSE;
if (g_getenv ("FWUPD_VLI_USBHUB_VERBOSE") != NULL)
fu_common_dump_raw (G_LOG_DOMAIN, "I2cWriteData", buf, datasz + 2);
if (!g_usb_device_control_transfer (usb_device,

View File

@ -7,6 +7,7 @@
#define G_LOG_DOMAIN "FuKeyring"
#include <config.h>
#include <string.h>
#include "fwupd-error.h"