Kevin Wolf wrote:
...
I'm currently working on fixing exactly this, and unfortunaly, no, it's
not that easy. What you introduce looks like proper error handling at
first sight, but what happens in fact is that while the current write
request correctly fails now we're running with corrupted
2001
From: Jim Meyering meyer...@redhat.com
Date: Mon, 8 Feb 2010 18:29:29 +0100
Subject: [PATCH] don't dereference NULL after failed strdup
Handle failing strdup by replacing each use with qemu_strdup,
so as not to dereference NULL or trigger a failing assertion.
* block/curl.c (curl_open): s
From: Jim Meyering meyer...@redhat.com
v9fs_add_dir_node and qemu_v9fs_synth_add_file used strncpy
to form node-name, which requires NUL-termination, but
strncpy does not ensure NUL-termination.
Use pstrcpy, which does.
Signed-off-by: Jim Meyering meyer...@redhat.com
---
hw/9pfs/virtio-9p
From: Jim Meyering meyer...@redhat.com
A terminal NUL is required by caller's use of strchr.
It's better not to use strncpy at all, since there is no need
to zero out hundreds of trailing bytes for each iteration.
Signed-off-by: Jim Meyering meyer...@redhat.com
---
target-ppc/kvm.c | 2 +-
1
From: Jim Meyering meyer...@redhat.com
Adjust all uses s/strzcpy/strncpy/ and mark these uses
of strncpy as ok.
Signed-off-by: Jim Meyering meyer...@redhat.com
---
hw/acpi.c | 24
1 file changed, 8 insertions(+), 16 deletions(-)
diff --git a/hw/acpi.c b/hw/acpi.c
index
From: Jim Meyering meyer...@redhat.com
Don't bother with strncpy. There's no need for its zero-fill.
Use g_strndup in place of g_malloc+strncpy+NUL-terminate.
Signed-off-by: Jim Meyering meyer...@redhat.com
---
ui/vnc-auth-sasl.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff
Peter Maydell wrote:
On 9 May 2012 10:23, Jim Meyering j...@meyering.net wrote:
From: Jim Meyering meyer...@redhat.com
Remove unnecessary and unchecked uses of strdup,
and add a comment that this strncpy use is ok.
Signed-off-by: Jim Meyering meyer...@redhat.com
---
linux-user/elfload.c
From: Jim Meyering meyer...@redhat.com
os_set_proc_name: Use pstrcpy, in place of strncpy and the
ineffectual preceding assignment: name[sizeof(name) - 1] = 0;
Signed-off-by: Jim Meyering meyer...@redhat.com
---
os-posix.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/os
From: Jim Meyering meyer...@redhat.com
strncpy does not guarantee NUL-termination.
Setting dest[n-1] = '\0' *before* calling strncpy(dest, src, n-1)
is a no-op. Use pstrcpy to ensure NUL-termination, not strncpy.
Signed-off-by: Jim Meyering meyer...@redhat.com
---
block/vmdk.c | 3 +--
1 file
From: Jim Meyering meyer...@redhat.com
Also, use PATH_MAX, rather than the arbitrary 1024.
Using PATH_MAX is more consistent with other filename-related
variables in this file, like backing_filename and tmp_filename.
Signed-off-by: Jim Meyering meyer...@redhat.com
---
block.c | 5 +++--
1 file
From: Jim Meyering meyer...@redhat.com
Replace strncpy+NUL-terminate use with use of pstrcpy.
This requires linking with cutils.o (or else vssclient doesn't link),
so add that in the Makefile.
Signed-off-by: Jim Meyering meyer...@redhat.com
---
libcacard/Makefile | 2 +-
libcacard
Peter Maydell wrote:
On 9 May 2012 14:42, Jim Meyering j...@meyering.net wrote:
From 5dce6a052cdc2a45ada3e3e96a8c3ef4e90f Mon Sep 17 00:00:00 2001
From: Jim Meyering meyer...@redhat.com
Date: Mon, 7 May 2012 18:34:26 +0200
Subject: [PATCH] linux-user: remove two unchecked uses of strdup
Kevin Wolf wrote:
Am 09.05.2012 11:23, schrieb Jim Meyering:
From: Jim Meyering meyer...@redhat.com
strncpy does not guarantee NUL-termination.
Setting dest[n-1] = '\0' *before* calling strncpy(dest, src, n-1)
is a no-op. Use pstrcpy to ensure NUL-termination, not strncpy.
It's
From: Jim Meyering meyer...@redhat.com
Remove unnecessary and unchecked uses of strdup,
and add a comment that this strncpy use is ok.
Signed-off-by: Jim Meyering meyer...@redhat.com
---
linux-user/elfload.c | 10 ++
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/linux
Peter Maydell wrote:
On 9 May 2012 15:01, Jim Meyering j...@meyering.net wrote:
From 402100deb7e27b1d7ac619ebac963f861fae91b0 Mon Sep 17 00:00:00 2001
From: Jim Meyering meyer...@redhat.com
Date: Mon, 7 May 2012 18:34:26 +0200
Subject: [PATCH] linux-user: remove two unchecked uses of strdup
Peter Maydell wrote:
On 9 May 2012 10:24, Jim Meyering j...@meyering.net wrote:
From: Jim Meyering meyer...@redhat.com
Adjust all uses s/strzcpy/strncpy/ and mark these uses
of strncpy as ok.
Note that this will conflict with Paolo's patch
http://patchwork.ozlabs.org/patch/151895
Aneesh Kumar K.V wrote:
Jim Meyering j...@meyering.net writes:
From: Jim Meyering meyer...@redhat.com
The use of strncpy in pt_listxattr is unnecessary, since we
know that the NUL-terminated source bytes fit in the destination
buffer. Use memcpy in place of strncpy.
Signed-off-by: Jim
From: Jim Meyering meyer...@redhat.com
Signed-off-by: Jim Meyering meyer...@redhat.com
---
block/qcow2.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/block/qcow2.c b/block/qcow2.c
index 8c60a6f..abc985e 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -990,6 +990,7 @@ int
From: Jim Meyering meyer...@redhat.com
Don't use strncpy when the source string is known to fit
in the destination buffer. Use equivalent memcpy.
We could even use strcpy, here, but some static analyzers
warn about that, so don't add new uses.
Signed-off-by: Jim Meyering meyer...@redhat.com
From: Jim Meyering meyer...@redhat.com
In both mp_pacl_listxattr and mp_dacl_listxattr, the uses of strncpy
were unnecessary, since at each point of use we know that the
NUL-terminated source bytes fit in the destination buffer.
Use memcpy in place of strncpy.
Signed-off-by: Jim Meyering meyer
From: Jim Meyering meyer...@redhat.com
NUL-termination of the .ifr_name field is not required, but is fine
(and preferable to using strncpy and leaving the reader to wonder),
since the first thing the linux kernel does is to clear the last byte.
Besides, using pstrcpy here makes this setting
From: Jim Meyering meyer...@redhat.com
The use of strncpy in pt_listxattr is unnecessary, since we
know that the NUL-terminated source bytes fit in the destination
buffer. Use memcpy in place of strncpy.
Signed-off-by: Jim Meyering meyer...@redhat.com
---
hw/9pfs/virtio-9p-xattr.c | 3 ++-
1
From: Jim Meyering meyer...@redhat.com
The use of strncpy in mp_user_listxattr is unnecessary, since we
know that the NUL-terminated source bytes fit in the destination
buffer. Use memcpy in place of strncpy.
Signed-off-by: Jim Meyering meyer...@redhat.com
---
hw/9pfs/virtio-9p-xattr-user.c
From: Jim Meyering meyer...@redhat.com
* parse_vdiname: Use pstrcpy, not strncpy, when the destination
buffer must be NUL-terminated.
* sd_open: Likewise, avoid buffer overrun.
* do_sd_create: Likewise. Leave the preceding memset, since
pstrcpy does not NUL-fill, and filename needs
From: Jim Meyering meyer...@redhat.com
In bt_hci_name_req a failed snprintf could return len larger than
sizeof(params.name), which means the following memset call would
have a length value of (size_t)-1, -2, etc... Sounds scary.
But currently, one can deduce that there is no problem:
strlen
Alexander Graf wrote:
Hrm :)
That appears to be due to scripts/get_maintainer.pl not sanitizing
its output addresses. E.g., using my 06/22 patch, I get this bogus Cc:
$ scripts/get_maintainer.pl 0006-*|grep open
qemu-devel@nongnu.org (open list:POSIX)
Original Message
Peter Maydell wrote:
Signed-off-by: Peter Maydell peter.mayd...@linaro.org
---
NB: might trivially textually conflict with Jim Meyering's
strncpy fix here. (I spotted this typo in the context lines
for his patch...)
qga/commands-posix.c |2 +-
1 files changed, 1 insertions(+), 1
/test-mmap.c
Signed-off-by: Jim Meyering meyer...@redhat.com
---
Changelog | 2 +-
coroutine-sigaltstack.c | 2 +-
disas.c | 2 +-
hw/usb/hcd-ehci.c | 4 ++--
qapi-schema-guest.json | 2 +-
qemu-ga.c | 2 +-
qga/commands-posix.c| 4 ++--
tests/tcg
From: Jim Meyering meyer...@redhat.com
Signed-off-by: Jim Meyering meyer...@redhat.com
---
hw/r2d.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/hw/r2d.c b/hw/r2d.c
index c55de01..ed841c5 100644
--- a/hw/r2d.c
+++ b/hw/r2d.c
@@ -328,6 +328,8 @@ static void r2d_init(ram_addr_t ram_size
From: Jim Meyering meyer...@redhat.com
Reword the section on strncpy: its NUL-filling is important
in some cases. Mention that pstrcpy's signature is different.
Signed-off-by: Jim Meyering meyer...@redhat.com
---
HACKING | 9 +
1 file changed, 5 insertions(+), 4 deletions(-)
diff
[Hmm... This was supposed to be the first in the series]
Given qemu's HACKING comments, I'm sure many here have read man strncpy,
where it indicates it is often not the best function to use.
However, many of the uses of strncpy in qemu mistakenly fail to ensure
that the destination buffer is
[Argh. First attempt omitted the most important address: qemu-devel.
Sorry to all who get two copies. ]
Given qemu's HACKING comments, I'm sure many here have read man strncpy,
where it indicates it is often not the best function to use.
However, many of the uses of strncpy in qemu mistakenly
From: Jim Meyering meyer...@redhat.com
Signed-off-by: Jim Meyering meyer...@redhat.com
---
hw/scsi-bus.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/scsi-bus.c b/hw/scsi-bus.c
index dbdb99c..916f425 100644
--- a/hw/scsi-bus.c
+++ b/hw/scsi-bus.c
@@ -402,6 +402,7 @@ static bool
From: Jim Meyering meyer...@redhat.com
Actually do what the comment says, using pstrcpy to NUL-terminate:
strncpy does not always do that.
Signed-off-by: Jim Meyering meyer...@redhat.com
---
hw/lm32_hwsetup.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/lm32_hwsetup.h
From: Jim Meyering meyer...@redhat.com
Use pstrcpy rather than strncpy in one more case
(in cpudef_setfield). This makes our handling of -model_id
consistent with another pstrcpy-vs-model_id use below.
Signed-off-by: Jim Meyering meyer...@redhat.com
---
target-i386/cpu.c | 2 +-
1 file changed
-mmap.c
Also, manually fix arithmentic, spotted by Peter Maydell:
sed -i 's!arithmentic!arithmetic!' coroutine-sigaltstack.c
Signed-off-by: Jim Meyering meyer...@redhat.com
---
...
Also arithmetic.
Thanks. Amended.
Changelog | 2 +-
coroutine-sigaltstack.c | 2 +-
disas.c
Andreas Färber wrote:
Am 09.05.2012 14:38, schrieb Jim Meyering:
Alexander Graf wrote:
Hrm :)
That appears to be due to scripts/get_maintainer.pl not sanitizing
its output addresses. E.g., using my 06/22 patch, I get this bogus Cc:
$ scripts/get_maintainer.pl 0006-*|grep open
Kevin Wolf wrote:
Am 09.05.2012 11:23, schrieb Jim Meyering:
[Argh. First attempt omitted the most important address: qemu-devel.
Sorry to all who get two copies. ]
Given qemu's HACKING comments, I'm sure many here have read man strncpy,
where it indicates it is often not the best function
From: Jim Meyering meyer...@redhat.com
I ran coverity on all of qemu and have begun going through the results.
A couple problems jumped out as obvious and easy to fix:
Jim Meyering (2):
kvm/apic: correct short memset
cadence_gem: avoid stack-writing buffer-overrun
hw/cadence_gem.c | 2
From: Jim Meyering meyer...@redhat.com
Use sizeof(rxbuf)-size (not sizeof(rxbuf-size)) as the number
of bytes to clear. The latter would always clear 4 or 8
bytes, possibly writing beyond the end of that stack buffer.
Alternatively, depending on the value of the size parameter,
it could fail
From: Jim Meyering meyer...@redhat.com
kvm_put_apic_state's attempt to clear *kapic before setting its
bits cleared sizeof(void*) bytes (no more than 8) rather than the
intended 1024 (KVM_APIC_REG_SIZE) bytes. Spotted by coverity.
Signed-off-by: Jim Meyering meyer...@redhat.com
---
hw/kvm
.
From 49f786191ab2a8176eb44a78e3d5ba44da6e10b6 Mon Sep 17 00:00:00 2001
From: Jim Meyering meyer...@redhat.com
Date: Thu, 10 May 2012 18:25:51 +0200
Subject: [PATCH] .
Signed-off-by: Jim Meyering meyer...@redhat.com
---
hw/usb/hcd-ehci.c | 5 +
1 file changed, 5 insertions(+)
diff --git a/hw
Move code that sets aiocb-ret and aiocb-active into critical section.
All other accesses are lock-guarded. Spotted by coverity.
Signed-off-by: Jim Meyering meyer...@redhat.com
---
I've included enough context to show one of the
guarded uses in the following function.
posix-aio-compat.c | 2
Kevin Wolf wrote:
Am 15.05.2012 13:27, schrieb Jim Meyering:
Move code that sets aiocb-ret and aiocb-active into critical section.
All other accesses are lock-guarded. Spotted by coverity.
Signed-off-by: Jim Meyering meyer...@redhat.com
---
I've included enough context to show one
From: Jim Meyering meyer...@redhat.com
Signed-off-by: Jim Meyering meyer...@redhat.com
---
block/qcow2.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/block/qcow2.c b/block/qcow2.c
index 655799c..f3388bf 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -919,6 +919,7 @@ int
From: Jim Meyering meyer...@redhat.com
These changes fix most of the legitimate coverity-reported leak warnings.
Jim Meyering (6):
qcow2: don't leak buffer for unexpected qcow_version in header
qemu-ga: avoid unconditional lockfile file descriptor leak
linux-user: do_msgrcv: don't leak
From: Jim Meyering meyer...@redhat.com
Signed-off-by: Jim Meyering meyer...@redhat.com
---
block/sheepdog.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/block/sheepdog.c b/block/sheepdog.c
index e01d371..a5c834f 100644
--- a/block/sheepdog.c
+++ b/block/sheepdog.c
@@ -489,6 +489,7
From: Jim Meyering meyer...@redhat.com
Signed-off-by: Jim Meyering meyer...@redhat.com
---
linux-user/syscall.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 20d2a74..bdf8ce0 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
From: Jim Meyering meyer...@redhat.com
Use g_malloc/g_free in place of malloc/free.
Signed-off-by: Jim Meyering meyer...@redhat.com
---
softmmu-semi.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/softmmu-semi.h b/softmmu-semi.h
index 648cb95..996e0f7 100644
From: Jim Meyering meyer...@redhat.com
Do not leak a file descriptor.
Also, do not forget to unlink the lockfile upon failed lockf.
Always close the lockfile file descriptor, taking care
to diagnose close, as well as open and write, failure.
Signed-off-by: Jim Meyering meyer...@redhat.com
From: Jim Meyering meyer...@redhat.com
Always call unlock_user before returning.
.
Signed-off-by: Jim Meyering meyer...@redhat.com
---
arm-semi.c | 13 +++--
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/arm-semi.c b/arm-semi.c
index 88ca9bb..5d2a2d2 100644
--- a/arm
Peter Maydell wrote:
On 16 May 2012 14:07, Jim Meyering j...@meyering.net wrote:
From: Jim Meyering meyer...@redhat.com
Signed-off-by: Jim Meyering meyer...@redhat.com
---
linux-user/syscall.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/linux-user/syscall.c b/linux-user
Also, use g_malloc to avoid NULL-deref upon OOM.
Signed-off-by: Jim Meyering meyer...@redhat.com
---
There are other, similar NULL-deref risks in this file.
TBD separately.
linux-user/syscall.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/linux-user/syscall.c b/linux
Michael Roth wrote:
On Wed, May 16, 2012 at 03:07:57PM +0200, Jim Meyering wrote:
From: Jim Meyering meyer...@redhat.com
Do not leak a file descriptor.
Also, do not forget to unlink the lockfile upon failed lockf.
Always close the lockfile file descriptor, taking care
to diagnose close
Signed-off-by: Jim Meyering meyer...@redhat.com
---
qemu-ga.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/qemu-ga.c b/qemu-ga.c
index 680997e..24b236a 100644
--- a/qemu-ga.c
+++ b/qemu-ga.c
@@ -246,6 +246,9 @@ static bool ga_open_pidfile(const char *pidfile)
pidfd = open(pidfile
From: Jim Meyering meyer...@redhat.com
I noticed this commit,
virtio-pci: add missing 'static'
which made this change:
-const MemoryRegionPortio virtio_portio[] = {
+static const MemoryRegionPortio virtio_portio[] = {
and wondered if there were other variables like
From: Jim Meyering meyer...@redhat.com
Signed-off-by: Jim Meyering meyer...@redhat.com
---
hw/xen_backend.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/hw/xen_backend.c b/hw/xen_backend.c
index 66cb144..e44ced0 100644
--- a/hw/xen_backend.c
+++ b/hw/xen_backend.c
@@ -47,7 +47,6
From: Jim Meyering meyer...@redhat.com
Signed-off-by: Jim Meyering meyer...@redhat.com
---
hw/scsi-bus.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/scsi-bus.c b/hw/scsi-bus.c
index 8ab9bcd..f10f3ec 100644
--- a/hw/scsi-bus.c
+++ b/hw/scsi-bus.c
@@ -1561,7 +1561,7
From: Jim Meyering meyer...@redhat.com
Signed-off-by: Jim Meyering meyer...@redhat.com
---
qemu-config.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/qemu-config.c b/qemu-config.c
index be84a03..c03e52b 100644
--- a/qemu-config.c
+++ b/qemu-config.c
@@ -528,7 +528,7
Blue Swirl wrote:
On Tue, May 15, 2012 at 1:04 PM, j...@meyering.net wrote:
From: Jim Meyering meyer...@redhat.com
Without this, envlist_to_environ may silently fail to copy all
strings into the destination buffer, and both callers would leak
any env strings allocated after a failing strdup
Signed-off-by: Jim Meyering meyer...@redhat.com
---
Thanks to Kevin Wolf for the improvement.
block/qcow2.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/block/qcow2.c b/block/qcow2.c
index 655799c..c2e49cd 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -919,7 +919,8
Kevin Wolf wrote:
Am 16.05.2012 15:07, schrieb Jim Meyering:
From: Jim Meyering meyer...@redhat.com
Signed-off-by: Jim Meyering meyer...@redhat.com
---
block/qcow2.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/block/qcow2.c b/block/qcow2.c
index 655799c..f3388bf 100644
Blue Swirl wrote:
On Mon, May 21, 2012 at 10:03 AM, Jim Meyering j...@meyering.net wrote:
From: Jim Meyering meyer...@redhat.com
I noticed this commit,
virtio-pci: add missing 'static'
which made this change:
-const MemoryRegionPortio virtio_portio[] = {
+static const
Blue Swirl wrote:
On Mon, May 21, 2012 at 6:10 PM, Jim Meyering j...@meyering.net wrote:
Blue Swirl wrote:
On Mon, May 21, 2012 at 10:03 AM, Jim Meyering j...@meyering.net wrote:
From: Jim Meyering meyer...@redhat.com
I noticed this commit,
virtio-pci: add missing 'static'
which made
From: Jim Meyering meyer...@redhat.com
Following up on discussion here,
http://marc.info/?t=13375948768r=1w=2
here are patches to limit the scope of the remaining global variables.
Most changes simply added a preceding static. However, in some cases,
I've made minor additional changes
From: Jim Meyering meyer...@redhat.com
Signed-off-by: Jim Meyering meyer...@redhat.com
---
hw/ccid-card-passthru.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/ccid-card-passthru.c b/hw/ccid-card-passthru.c
index bd6c777..1caaa45 100644
--- a/hw/ccid-card-passthru.c
From: Jim Meyering meyer...@redhat.com
Signed-off-by: Jim Meyering meyer...@redhat.com
---
hw/ccid-card-passthru.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/ccid-card-passthru.c b/hw/ccid-card-passthru.c
index bd6c777..1caaa45 100644
--- a/hw/ccid-card-passthru.c
From: Jim Meyering meyer...@redhat.com
Signed-off-by: Jim Meyering meyer...@redhat.com
---
tcg/tcg.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tcg/tcg.c b/tcg/tcg.c
index ab589c7..350fdad 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -2293,7 +2293,7 @@ void
From: Jim Meyering meyer...@redhat.com
Signed-off-by: Jim Meyering meyer...@redhat.com
---
tcg/tcg.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tcg/tcg.c b/tcg/tcg.c
index ab589c7..350fdad 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -2293,7 +2293,7 @@ void
From: Jim Meyering meyer...@redhat.com
alpha_num_operands: Remove both declarations of this unused global.
alpha_opcodes: Declare static to limit scope. Remove duplicate decl.
alpha_num_opcodes: Likewise.
alpha_operands: Likewise.
Signed-off-by: Jim Meyering meyer...@redhat.com
---
alpha-dis.c
From: Jim Meyering meyer...@redhat.com
alpha_num_operands: Remove both declarations of this unused global.
alpha_opcodes: Declare static to limit scope. Remove duplicate decl.
alpha_num_opcodes: Likewise.
alpha_operands: Likewise.
Signed-off-by: Jim Meyering meyer...@redhat.com
---
alpha-dis.c
From: Jim Meyering meyer...@redhat.com
Signed-off-by: Jim Meyering meyer...@redhat.com
---
block/sheepdog.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/block/sheepdog.c b/block/sheepdog.c
index e01d371..fdb3eca 100644
--- a/block/sheepdog.c
+++ b/block/sheepdog.c
From: Jim Meyering meyer...@redhat.com
Declare arg_table to be static const, and adjust the two users
to also be const.
Signed-off-by: Jim Meyering meyer...@redhat.com
---
linux-user/main.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/linux-user/main.c b/linux-user
From: Jim Meyering meyer...@redhat.com
Signed-off-by: Jim Meyering meyer...@redhat.com
---
hw/bonito.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/bonito.c b/hw/bonito.c
index 77786f8..6bd0242 100644
--- a/hw/bonito.c
+++ b/hw/bonito.c
@@ -218,7 +218,7 @@ typedef
From: Jim Meyering meyer...@redhat.com
Signed-off-by: Jim Meyering meyer...@redhat.com
---
hw/ccid-card-emulated.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/hw/ccid-card-emulated.c b/hw/ccid-card-emulated.c
index f4a6da4..440f050 100644
--- a/hw/ccid-card
Peter Maydell wrote:
On 21 May 2012 20:51, Jim Meyering j...@meyering.net wrote:
From: Jim Meyering meyer...@redhat.com
Signed-off-by: Jim Meyering meyer...@redhat.com
---
tcg/tcg.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tcg/tcg.c b/tcg/tcg.c
index ab589c7
From: Jim Meyering meyer...@redhat.com
Signed-off-by: Jim Meyering meyer...@redhat.com
---
mips-dis.c | 15 +++
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/mips-dis.c b/mips-dis.c
index e3a6e0b..f6109a1 100644
--- a/mips-dis.c
+++ b/mips-dis.c
@@ -888,10 +888,9
From: Jim Meyering meyer...@redhat.com
Minor exceptions:
* arm-dis: move now-detected-as-unused static variables into #if-0'd
block of code where they *are* used.
* microblaze: remove decls of now-detected-as-unused vars
Signed-off-by: Jim Meyering meyer...@redhat.com
---
arm-dis.c
From: Jim Meyering meyer...@redhat.com
Per discussion, let's switch envlist.c to indent with spaces,
and then make the fix:
Jim Meyering (2):
envlist.c: convert many leading TABs to spaces via expand -i
envlist.c: handle strdup failure
envlist.c | 272
From: Jim Meyering meyer...@redhat.com
Signed-off-by: Jim Meyering meyer...@redhat.com
---
envlist.c | 256 +++---
1 file changed, 128 insertions(+), 128 deletions(-)
diff --git a/envlist.c b/envlist.c
index f2303cd..1d98108 100644
From: Jim Meyering meyer...@redhat.com
Without this, envlist_to_environ may silently fail to copy all
strings into the destination buffer, and both callers would leak
any env strings allocated after a failing strdup, because the
freeing code stops at the first NULL pointer.
Signed-off-by: Jim
Kevin Wolf wrote:
A patch replacing tabs by spaces isn't really the kind of patches that
we would want to avoid during freeze. It's easy enough to check with git
diff -w that it doesn't change anything semantically.
That makes sense, so I've posted two patches:
1) two patches: one
From: Jim Meyering meyer...@redhat.com
This is the same as v1, except that two lines of non-leading TABs
in envlist.c (indenting comments after code) have also been converted
to use equivalent spaces instead of TABs.
Jim Meyering (2):
envlist.c: convert all TABs to equivalent spaces
From: Jim Meyering meyer...@redhat.com
Without this, envlist_to_environ may silently fail to copy all
strings into the destination buffer, and both callers would leak
any env strings allocated after a failing strdup, because the
freeing code stops at the first NULL pointer.
Signed-off-by: Jim
From: Jim Meyering meyer...@redhat.com
Signed-off-by: Jim Meyering meyer...@redhat.com
---
envlist.c | 256 +++---
1 file changed, 128 insertions(+), 128 deletions(-)
diff --git a/envlist.c b/envlist.c
index f2303cd..be0addb 100644
Kevin Wolf wrote:
Am 22.05.2012 11:05, schrieb Jim Meyering:
Kevin Wolf wrote:
A patch replacing tabs by spaces isn't really the kind of patches that
we would want to avoid during freeze. It's easy enough to check with git
diff -w that it doesn't change anything semantically.
That makes
From: Jim Meyering meyer...@redhat.com
Same as v2, but now with TABs converted using expand --tabs=4.
Jim Meyering (2):
envlist.c: convert each TAB(width-4) to equivalent spaces
envlist.c: handle strdup failure
envlist.c | 272
From: Jim Meyering meyer...@redhat.com
Signed-off-by: Jim Meyering meyer...@redhat.com
---
envlist.c | 256 +++---
1 file changed, 128 insertions(+), 128 deletions(-)
diff --git a/envlist.c b/envlist.c
index f2303cd..e44889b 100644
From: Jim Meyering meyer...@redhat.com
Add comments so no one else will be tempted to reduce the scope
of this global variable.
Signed-off-by: Jim Meyering meyer...@redhat.com
---
tcg/tcg.c | 10 +++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/tcg/tcg.c b/tcg/tcg.c
Peter Maydell wrote:
On 21 May 2012 21:10, Jim Meyering j...@meyering.net wrote:
Peter Maydell wrote:
On 21 May 2012 20:51, Jim Meyering j...@meyering.net wrote:
From: Jim Meyering meyer...@redhat.com
Signed-off-by: Jim Meyering meyer...@redhat.com
---
tcg/tcg.c | 2 +-
1 file changed
Peter Maydell wrote:
On 22 May 2012 10:50, Jim Meyering j...@meyering.net wrote:
From: Jim Meyering meyer...@redhat.com
If we're going to go to the effort of a complete reindent
patch we should actually reindent to the QEMU coding style
standard, which is four-space, not eight.
Good point
From: Jim Meyering meyer...@redhat.com
Without this, envlist_to_environ may silently fail to copy all
strings into the destination buffer, and both callers would leak
any env strings allocated after a failing strdup, because the
freeing code stops at the first NULL pointer.
Signed-off-by: Jim
Return NULL upon malloc failure.
Signed-off-by: Jim Meyering meyer...@redhat.com
---
Improved based on suggestion from Peter Maydell:
Handle malloc failure rather than relying on g_malloc, since we
can't afford to let guest-provided len induce g_malloc's abort.
softmmu-semi.h | 5 -
1 file
Peter Maydell wrote:
On 16 May 2012 14:08, Jim Meyering j...@meyering.net wrote:
From: Jim Meyering meyer...@redhat.com
Use g_malloc/g_free in place of malloc/free.
Signed-off-by: Jim Meyering meyer...@redhat.com
---
softmmu-semi.h | 6 +++---
1 file changed, 3 insertions(+), 3
-2652.
http://bugzilla.redhat.com/CVE-2012-2652
Signed-off-by: Jim Meyering meyer...@redhat.com
---
Note that I haven't tried to see if the _WIN32 -GetLastError() return
value is properly diagnosed as it is propagated up the call stack.
block.c | 37
Anthony Liguori wrote:
On 05/09/2012 10:12 PM, Jim Meyering wrote:
Peter Maydell wrote:
On 9 May 2012 15:01, Jim Meyeringj...@meyering.net wrote:
From 402100deb7e27b1d7ac619ebac963f861fae91b0 Mon Sep 17 00:00:00 2001
From: Jim Meyeringmeyer...@redhat.com
Date: Mon, 7 May 2012 18:34:26
From: Jim Meyering meyer...@redhat.com
Also, use PATH_MAX, rather than the arbitrary 1024.
Using PATH_MAX is more consistent with other filename-related
variables in this file, like backing_filename and tmp_filename.
Acked-by: Kevin Wolf kw...@redhat.com
Signed-off-by: Jim Meyering meyer
From: Jim Meyering meyer...@redhat.com
Signed-off-by: Jim Meyering meyer...@redhat.com
---
hw/r2d.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/hw/r2d.c b/hw/r2d.c
index c55de01..ed841c5 100644
--- a/hw/r2d.c
+++ b/hw/r2d.c
@@ -328,6 +328,8 @@ static void r2d_init(ram_addr_t ram_size
Anthony Liguori wrote:
On 05/30/2012 03:12 PM, Jim Meyering wrote:
Anthony Liguori wrote:
On 05/09/2012 10:12 PM, Jim Meyering wrote:
Peter Maydell wrote:
On 9 May 2012 15:01, Jim Meyeringj...@meyering.net wrote:
From 402100deb7e27b1d7ac619ebac963f861fae91b0 Mon Sep 17 00:00:00 2001
From: Jim Meyering meyer...@redhat.com
A terminal NUL is required by caller's use of strchr.
It's better not to use strncpy at all, since there is no need
to zero out hundreds of trailing bytes for each iteration.
Signed-off-by: Jim Meyering meyer...@redhat.com
---
target-ppc/kvm.c | 2 +-
1
1 - 100 of 157 matches
Mail list logo