[Qemu-devel] [PATCH for-3.1? 0/3] strcpy: fix stringop-truncation warnings

Marc-André Lureau posted 3 patches 5 years, 5 months ago
Test asan passed
Test checkpatch passed
Test docker-quick@centos7 passed
Test docker-mingw@fedora passed
Test docker-clang@ubuntu passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20181120152753.10463-1-marcandre.lureau@redhat.com
block/sheepdog.c         |  1 +
hw/acpi/aml-build.c      |  6 ++++--
hw/acpi/core.c           | 13 +++++++------
migration/global_state.c |  1 +
4 files changed, 13 insertions(+), 8 deletions(-)
[Qemu-devel] [PATCH for-3.1? 0/3] strcpy: fix stringop-truncation warnings
Posted by Marc-André Lureau 5 years, 5 months ago
Hi,

Some of those warnings have already been fixed, others have been
delayed as it could make sense to disable/ignoring the warning, or
write a custom strncpy() function.

In some cases where NUL-ending string is not mandatory (because the
string length is bound in some format or protocol), we can replace
strncpy() with qemu strpadcpy(), so that the destination string is
still NUL-ending in cases where the destination is larger than the
source string.

Some warnings can be shut up with assert() lines in some cases.

Marc-André Lureau (3):
  sheepdog: fix stringop-truncation warning
  migration: fix stringop-truncation warning
  acpi: fix stringop-truncation warnings

 block/sheepdog.c         |  1 +
 hw/acpi/aml-build.c      |  6 ++++--
 hw/acpi/core.c           | 13 +++++++------
 migration/global_state.c |  1 +
 4 files changed, 13 insertions(+), 8 deletions(-)

-- 
2.19.1.708.g4ede3d42df