qemu/hw
Stefan Hajnoczi f93cfdc583 hw/rdma: avoid suspicious strncpy() use
gcc (GCC) 9.2.1 20190827 (Red Hat 9.2.1-1) with sanitizers enabled
reports the following error:

  CC      x86_64-softmmu/hw/rdma/vmw/pvrdma_dev_ring.o
In file included from /usr/include/string.h:495,
                 from include/qemu/osdep.h:101,
                 from hw/rdma/vmw/pvrdma_dev_ring.c:16:
In function ‘strncpy’,
    inlined from ‘pvrdma_ring_init’ at hw/rdma/vmw/pvrdma_dev_ring.c:33:5:
/usr/include/bits/string_fortified.h:106:10: error: ‘__builtin_strncpy’ specified bound 32 equals destination size [-Werror=stringop-truncation]
  106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Use pstrcpy() instead of strncpy().  It is guaranteed to NUL-terminate
strings.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Yuval Shaia <yuval.shaia.ml.gmail.com>
Message-Id: <20200316160702.478964-3-stefanha@redhat.com>
Signed-off-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
2020-03-21 19:21:20 +02:00
..
9pfs 9p/proxy: Fix export_flags 2020-03-10 16:12:49 +01:00
acpi qom/object: Use common get/set uint helpers 2020-03-16 23:02:24 +01:00
adc hw/*/Makefile.objs: Move many .o files to common-objs 2020-02-04 09:00:57 +01:00
alpha hw/ide: Do ide_drive_get() within pci_ide_create_devs() 2020-03-17 12:22:36 -04:00
arm * Bugfixes all over the place 2020-03-17 18:33:05 +00:00
audio hw/audio/intel-hda: Use memory region alias to reduce .rodata by 4.34MB 2020-03-16 23:02:25 +01:00
block Error reporting patches for 2020-03-17 2020-03-18 17:57:40 +00:00
char hw/char: Let devices own the MemoryRegion they create 2020-03-17 15:18:49 +01:00
core compat: disable edid on correct virtio-gpu device 2020-03-20 07:50:52 +01:00
cpu cpu/arm11mpcore: Set number of GIC priority bits to 4 2020-02-28 16:14:57 +00:00
cris hw: Make MachineClass::is_default a boolean type 2020-02-28 14:57:19 -05:00
display hw/display: Let devices own the MemoryRegion they create 2020-03-17 15:18:48 +01:00
dma hw/dma: Let devices own the MemoryRegion they create 2020-03-17 15:18:49 +01:00
gpio hw/*/Makefile.objs: Move many .o files to common-objs 2020-02-04 09:00:57 +01:00
hppa hw/ide: Remove unneeded inclusion of hw/ide.h 2020-03-17 12:22:36 -04:00
hyperv add device_legacy_reset function to prepare for reset api change 2020-01-30 16:02:03 +00:00
i2c hw/i2c/smbus_ich9: Include "qemu/range.h" 2020-03-09 15:59:31 +01:00
i386 x86 and machine queue for 5.0 soft freeze 2020-03-19 14:22:46 +00:00
ide hw/ide: Do ide_drive_get() within pci_ide_create_devs() 2020-03-17 12:22:36 -04:00
input hw/input: Do not enable CONFIG_PCKBD by default 2020-02-04 09:01:31 +01:00
intc spapr/xive: use SPAPR_IRQ_IPI to define IPI ranges exposed to the guest 2020-03-17 15:08:50 +11:00
ipack qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
ipmi qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
isa Pull request 2020-03-19 11:14:24 +00:00
lm32 hw: Make MachineClass::is_default a boolean type 2020-02-28 14:57:19 -05:00
m68k hw/m68k: Use memory_region_init_rom() with read-only regions 2020-03-17 15:18:47 +01:00
mem spapr: Add NVDIMM device support 2020-02-21 09:15:04 +11:00
microblaze hw: Make MachineClass::is_default a boolean type 2020-02-28 14:57:19 -05:00
mips hw/ide: Remove unneeded inclusion of hw/ide.h 2020-03-17 12:22:36 -04:00
misc Error reporting patches for 2020-03-17 2020-03-18 17:57:40 +00:00
moxie hw: Make MachineClass::is_default a boolean type 2020-02-28 14:57:19 -05:00
net * Bugfixes all over the place 2020-03-17 18:33:05 +00:00
nios2 hw: Make MachineClass::is_default a boolean type 2020-02-28 14:57:19 -05:00
nubus hw/m68k: add Nubus support 2019-10-28 19:06:47 +01:00
nvram misc: Replace zero-length arrays with flexible array member (automatic) 2020-03-16 22:07:42 +01:00
openrisc hw: Make MachineClass::is_default a boolean type 2020-02-28 14:57:19 -05:00
pci pci: Honour wmask when resetting PCI_INTERRUPT_LINE 2020-03-16 21:08:21 -04:00
pci-bridge pcie_root_port: Add hotplug disabling option 2020-03-08 09:18:29 -04:00
pci-host hw/pci-host: Use memory_region_init_rom() with read-only regions 2020-03-17 15:18:47 +01:00
pcmcia hw/*/Makefile.objs: Move many .o files to common-objs 2020-02-04 09:00:57 +01:00
ppc Pull request 2020-03-19 11:14:24 +00:00
rdma hw/rdma: avoid suspicious strncpy() use 2020-03-21 19:21:20 +02:00
riscv * Bugfixes all over the place 2020-03-17 18:33:05 +00:00
rtc hw/arm/allwinner: add RTC device support 2020-03-12 16:27:33 +00:00
s390x misc: Replace zero-length arrays with flexible array member (manual) 2020-03-16 22:07:42 +01:00
scsi hw/scsi/spapr_vscsi: Convert debug fprintf() to trace event 2020-03-17 15:08:50 +11:00
sd hw/sd/ssi-sd: fix error handling in ssi_sd_realize 2020-03-17 17:30:03 +01:00
semihosting semihosting: add qemu_semihosting_console_inc for SYS_READC 2020-01-09 11:41:29 +00:00
sh4 hw/sh4: Use memory_region_init_rom() with read-only regions 2020-03-17 15:18:47 +01:00
smbios hw/smbios/smbios: Remove unused include 2020-02-06 10:38:57 +01:00
sparc hw/sparc: Use memory_region_init_rom() with read-only regions 2020-03-17 15:18:48 +01:00
sparc64 hw/ide: Do ide_drive_get() within pci_ide_create_devs() 2020-03-17 12:22:36 -04:00
ssi aspeed/smc: Fix number of dummy cycles for FAST_READ_4 command 2020-03-17 11:36:44 +00:00
timer hw/timer/hpet: Include "exec/address-spaces.h" 2020-03-09 15:59:31 +01:00
tpm tpm: Add the SysBus TPM TIS device 2020-03-05 12:18:08 -05:00
tricore hw: Do not initialize MachineClass::is_default to 0 2020-02-28 14:57:19 -05:00
unicore32 hw: Make MachineClass::is_default a boolean type 2020-02-28 14:57:19 -05:00
usb * Bugfixes all over the place 2020-03-17 18:33:05 +00:00
vfio hw/vfio/display: Remove superfluous semicolon 2020-02-18 20:20:49 +01:00
virtio misc: Replace zero-length arrays with flexible array member (automatic) 2020-03-16 22:07:42 +01:00
watchdog qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
xen misc: Replace zero-length arrays with flexible array member (automatic) 2020-03-16 22:07:42 +01:00
xenpv trivial: Remove xenfb_enabled from sysemu.h 2020-02-04 09:00:57 +01:00
xtensa hw/xtensa/xtfpga:fix leak of fdevice tree blob 2020-02-19 10:33:38 +01:00
Kconfig Remove the core bluetooth code 2019-12-17 09:01:14 +01:00
Makefile.objs Remove the core bluetooth code 2019-12-17 09:01:14 +01:00