[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 13/42] sockets: avoid formatting buffer that may not
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 13/42] sockets: avoid formatting buffer that may not be NUL terminated |
Date: |
Wed, 5 Jul 2017 09:14:16 +0200 |
From: "Daniel P. Berrange" <address@hidden>
The 'sun_path' field in the sockaddr_un struct is not required
to be NUL termianted, so when reporting an error, we must use
the separate 'path' variable which is guaranteed terminated.
Fixes a bug spotted by coverity that was introduced in
commit ad9579aaa16d5b385922d49edac2c96c79bcfb62
Author: Daniel P. Berrange <address@hidden>
Date: Thu May 25 16:53:00 2017 +0100
sockets: improve error reporting if UNIX socket path is too long
Reviewed-by: Thomas Huth <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
util/qemu-sockets.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c
index 82290cb..d3e5108 100644
--- a/util/qemu-sockets.c
+++ b/util/qemu-sockets.c
@@ -897,7 +897,7 @@ static int unix_listen_saddr(UnixSocketAddress *saddr,
strncpy(un.sun_path, path, sizeof(un.sun_path));
if (bind(sock, (struct sockaddr*) &un, sizeof(un)) < 0) {
- error_setg_errno(errp, errno, "Failed to bind socket to %s",
un.sun_path);
+ error_setg_errno(errp, errno, "Failed to bind socket to %s", path);
goto err;
}
if (listen(sock, 1) < 0) {
--
1.8.3.1
- [Qemu-devel] [PULL 02/42] qemu-doc: Add missing "@c man end" statements, (continued)
- [Qemu-devel] [PULL 02/42] qemu-doc: Add missing "@c man end" statements, Paolo Bonzini, 2017/07/05
- [Qemu-devel] [PULL 04/42] target/i386: fix interrupt CPL error when using ist in x86-64, Paolo Bonzini, 2017/07/05
- [Qemu-devel] [PULL 03/42] nbd: fix NBD over TLS, Paolo Bonzini, 2017/07/05
- [Qemu-devel] [PULL 06/42] include/exec/poison: Add some more missing TARGET and CONFIG defines, Paolo Bonzini, 2017/07/05
- [Qemu-devel] [PULL 05/42] target/i386: simplify handling of conforming code segments on interrupt, Paolo Bonzini, 2017/07/05
- [Qemu-devel] [PULL 01/42] vcpu_dirty: share the same field in CPUState for all accelerators, Paolo Bonzini, 2017/07/05
- [Qemu-devel] [PULL 08/42] include/exec/poison: Mark CONFIG_KVM as poisoned, too, Paolo Bonzini, 2017/07/05
- [Qemu-devel] [PULL 07/42] Move CONFIG_KVM related definitions to kvm_i386.h, Paolo Bonzini, 2017/07/05
- [Qemu-devel] [PULL 09/42] cpu: Introduce a wrapper for tlb_flush() that can be used in common code, Paolo Bonzini, 2017/07/05
- [Qemu-devel] [PULL 15/42] util/oslib-win32: Remove if conditional, Paolo Bonzini, 2017/07/05
- [Qemu-devel] [PULL 13/42] sockets: avoid formatting buffer that may not be NUL terminated,
Paolo Bonzini <=
- [Qemu-devel] [PULL 11/42] Makefile: Move bootdevice.o to common-obj-y, Paolo Bonzini, 2017/07/05
- [Qemu-devel] [PULL 12/42] hw/misc/edu: Compile the edu device as common object, Paolo Bonzini, 2017/07/05
- [Qemu-devel] [PULL 17/42] main_loop: Make main_loop_wait() return void, Paolo Bonzini, 2017/07/05
- [Qemu-devel] [PULL 10/42] include/exec/poison: Mark CONFIG_SOFTMMU as poisoned, Paolo Bonzini, 2017/07/05
- [Qemu-devel] [PULL 18/42] checkpatch: should not use signal except for SIG_DFL or SIG_IGN, Paolo Bonzini, 2017/07/05
- [Qemu-devel] [PULL 14/42] xsave_helper: pull xsave and xrstor out of kvm.c into helper function, Paolo Bonzini, 2017/07/05
- [Qemu-devel] [PULL 16/42] tests/test-char.c: Don't use main_loop_wait()'s return value, Paolo Bonzini, 2017/07/05
- [Qemu-devel] [PULL 19/42] virtio-scsi: finalize IOMMU support, Paolo Bonzini, 2017/07/05
- [Qemu-devel] [PULL 22/42] configure: factor out list of supported Xen/KVM/HAX targets, Paolo Bonzini, 2017/07/05