From: Jim Meyering
Signed-off-by: Jim Meyering
---
hw/r2d.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/hw/r2d.c b/hw/r2d.c
index 0f16e81..1bc191f 100644
--- a/hw/r2d.c
+++ b/hw/r2d.c
@@ -332,6 +332,8 @@ static void r2d_init(ram_addr_t ram_size,
}
if (kernel_cmdline
From: Jim Meyering
* 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 that.
* sd_snapshot_create: Add
From: Jim Meyering
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
---
os-posix.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/os-posix.c b/os-posix.c
index eabccb8
From: Jim Meyering
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
---
HACKING | 9 +
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/HACKING b/HACKING
index 47
From: Jim Meyering
Use g_strdup rather than strdup, because the sole caller
(qdev_get_fw_dev_path_helper) assumes it gets non-NULL, and dereferences
it. Besides, in that caller, the allocated buffer is already freed with
g_free, so it's better to allocate with a matching g_strdup.
In one
From: Jim Meyering
Avoid strncpy+manual-NUL-terminate. Use pstrcpy instead.
Acked-by: Kevin Wolf
Signed-off-by: Jim Meyering
---
block/vmdk.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/block/vmdk.c b/block/vmdk.c
index f2e861b..1a80e5a 100644
--- a/block/vmdk.c
From: Jim Meyering
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
---
target-ppc/kvm.c | 2 +-
1 file changed, 1 insertion(+),
From: Jim Meyering
I included a quick classification of these change sets for the original series,
(see https://lists.gnu.org/archive/html/qemu-devel/2012-05/msg01151.html)
rebased in late May but perhaps the release-related timing was off.
I've rebased one last time to prepare this v3 s
From: Jim Meyering
Remove two uses of strdup (use g_path_get_basename instead),
and add a comment that this strncpy use is ok.
Reviewed-by: Peter Maydell
Signed-off-by: Jim Meyering
---
linux-user/elfload.c | 12 +++-
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a
From: Jim Meyering
This avoids a NULL-deref upon strdup failure.
Also update matching free to g_free.
Signed-off-by: Jim Meyering
---
target-sparc/cpu.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/target-sparc/cpu.c b/target-sparc/cpu.c
index f7c004c..eb9f0e7
From: Jim Meyering
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(slave->
From: Jim Meyering
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.
Acked-by: Alon Levy
Signed-off-by: Jim Meyering
---
libcacard/Makefile | 3 +++
libcacard/vcard_emul_nss.
Peter Maydell wrote:
> On 4 October 2012 12:09, Jim Meyering wrote:
>> From: Jim Meyering
>>
>> 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
From: Jim Meyering
In all of these cases, 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.
Acked-by: Aneesh Kumar K.V
Signed-off-by: Jim Meyering
---
hw/9pfs/virtio-9p
From: Jim Meyering
Adjust all uses s/strzcpy/strncpy/ and mark these uses
of strncpy as "ok".
Signed-off-by: Jim Meyering
---
hw/acpi.c | 24
1 file changed, 8 insertions(+), 16 deletions(-)
diff --git a/hw/acpi.c b/hw/acpi.c
index f7950be..f4aca49 10064
From: Jim Meyering
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.
Acked-by: David Gibson
Signed-off-by: Jim Meyerin
From: Jim Meyering
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 of ifr_name consistent
From: Jim Meyering
Acked-by: Kevin Wolf
Signed-off-by: Jim Meyering
---
block/qcow2.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/block/qcow2.c b/block/qcow2.c
index aa5e603..c1ff31f 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -1096,6 +1096,7 @@ int qcow2_update_header
From: Jim Meyering
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.
Acked-by: Aneesh Kumar K.V
Signed-off-by: Jim Meyering
---
hw/9pfs/virtio-9p-synth.c
From: Jim Meyering
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
---
ui/vnc-auth-sasl.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/ui/vnc-auth-sasl.
From: Jim Meyering
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
Signed-off-by: Jim Meyering
---
block.c | 5 +++--
1 file changed, 3
From: Jim Meyering
Actually do what the comment says, using pstrcpy NUL-terminate:
strncpy does not always do that.
Signed-off-by: Jim Meyering
---
hw/lm32_hwsetup.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/lm32_hwsetup.h b/hw/lm32_hwsetup.h
index 8fc285e
From: Jim Meyering
Return NULL upon malloc failure.
Signed-off-by: Jim Meyering
---
softmmu-semi.h | 5 -
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/softmmu-semi.h b/softmmu-semi.h
index 648cb95..bcb979a 100644
--- a/softmmu-semi.h
+++ b/softmmu-semi.h
@@ -40,7 +40,7
From: Jim Meyering
Signed-off-by: Jim Meyering
---
block/sheepdog.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/block/sheepdog.c b/block/sheepdog.c
index a04ad99..df4f441 100644
--- a/block/sheepdog.c
+++ b/block/sheepdog.c
@@ -485,6 +485,7 @@ static int connect_to_sdog(const char
From: Jim Meyering
Always call unlock_user before returning.
Signed-off-by: Jim Meyering
---
target-arm/arm-semi.c | 13 +++--
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/target-arm/arm-semi.c b/target-arm/arm-semi.c
index 2495206..73bde58 100644
--- a/target-arm/arm
From: Jim Meyering
Hi Anthony,
I posted this series back in May, got some good feedback leading to a
pair of v2 patches. Since then one of the 6 patches was applied.
I'm calling this v3, but it is merely a trivial rebase of the v1 and v2
patches. Hoping it's not too late for 1.2, he
From: Jim Meyering
Also, use g_malloc to avoid NULL-deref upon OOM.
Signed-off-by: Jim Meyering
---
linux-user/syscall.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 41c869b..1174306 100644
--- a/linux-user/syscall.c
From: Jim Meyering
Signed-off-by: Jim Meyering
---
qemu-ga.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/qemu-ga.c b/qemu-ga.c
index 8f87621..26671fe 100644
--- a/qemu-ga.c
+++ b/qemu-ga.c
@@ -247,6 +247,9 @@ static bool ga_open_pidfile(const char *pidfile)
pidfd = open
Andreas Färber wrote:
> Am 22.05.2012 12:16, schrieb Jim Meyering:
>> From: Jim Meyering
>>
>> 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 af
From: Jim Meyering
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 Meyering
From: Jim Meyering
Convert each TAB(width-4) to equivalent spaces.
Put braces around each one-line if-body.
Signed-off-by: Jim Meyering
---
envlist.c | 268 --
1 file changed, 140 insertions(+), 128 deletions(-)
diff --git a
From: Jim Meyering
Differences from v3 (no semantic change):
- change 1/2 so this file conforms more closely to QEMU's coding style,
by adding braces around each one-line if body (there was no one-line
else- or while-block).
- move an indentation correction from 2/2 into 1/2
Andreas Färber wrote:
> Am 17.08.2012 15:35, schrieb Jim Meyering:
>> Jim Meyering wrote:
>>> From: Jim Meyering
>>>
>>> Without this, envlist_to_environ may silently fail to copy all
>>> strings into the destination buffer, and both callers wou
Kevin Wolf wrote:
> Am 17.08.2012 15:30, schrieb Jim Meyering:
>> Kevin Wolf wrote:
>>> Am 16.05.2012 15:07, schrieb Jim Meyering:
>>>> From: Jim Meyering
>>>>
>>>> Signed-off-by: Jim Meyering
>>>
>>> Acked-by: Kevin
Jim Meyering wrote:
> From: Jim Meyering
>
> Following up on discussion here,
>
> http://marc.info/?t=13375948768&r=1&w=2
>
> here are patches to limit the scope of the remaining global variables.
> Most changes simply added a preceding "static".
Jim Meyering wrote:
> From: Jim Meyering
>
> 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 p
Kevin Wolf wrote:
> Am 16.05.2012 15:07, schrieb Jim Meyering:
>> From: Jim Meyering
>>
>> Signed-off-by: Jim Meyering
>
> Acked-by: Kevin Wolf
Hi Kevin,
AFAICS, only one of these 6 patches has been applied.
>From what I recall (it's been nearly 3mo), ther
Stefan Weil wrote:
> Am 30.05.2012 09:46, schrieb Jim Meyering:
>> From: Jim Meyering
>>
>> 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 tm
From: Jim Meyering
Actually do what the comment says, using pstrcpy NUL-terminate:
strncpy does not always do that.
Signed-off-by: Jim Meyering
---
hw/lm32_hwsetup.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/lm32_hwsetup.h b/hw/lm32_hwsetup.h
index 8fc285e
From: Jim Meyering
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 NUL-terminated.
From: Jim Meyering
Avoid strncpy+manual-NUL-terminate. Use pstrcpy instead.
Acked-by: Kevin Wolf
Signed-off-by: Jim Meyering
---
block/vmdk.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/block/vmdk.c b/block/vmdk.c
index 18e9b4c..bfd7357 100644
--- a/block/vmdk.c
From: Jim Meyering
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.
Acked-by: Alon Levy
Signed-off-by: Jim Meyering
---
libcacard/Makefile | 2 +-
libcacard/vcard_emul_nss.
From: Jim Meyering
Remove two uses of strdup (use g_path_get_basename instead),
and add a comment that this strncpy use is ok.
Reviewed-by: Peter Maydell
Signed-off-by: Jim Meyering
---
linux-user/elfload.c | 12 +++-
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a
From: Jim Meyering
Adjust all uses s/strzcpy/strncpy/ and mark these uses
of strncpy as "ok".
Signed-off-by: Jim Meyering
---
hw/acpi.c | 24
1 file changed, 8 insertions(+), 16 deletions(-)
diff --git a/hw/acpi.c b/hw/acpi.c
index 5d521e5..45ab345 10064
From: Jim Meyering
Signed-off-by: Jim Meyering
---
hw/scsi-bus.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/scsi-bus.c b/hw/scsi-bus.c
index 3edda28..98170c3 100644
--- a/hw/scsi-bus.c
+++ b/hw/scsi-bus.c
@@ -406,6 +406,7 @@ static bool scsi_target_emulate_inquiry(SCSITargetReq *r
From: Jim Meyering
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
---
ui/vnc-auth-sasl.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/ui/vnc-auth-sasl.
From: Jim Meyering
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
---
target-i386/cpu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
d
From: Jim Meyering
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
---
os-posix.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/os-posix.c b/os-posix.c
index daf3d6f
From: Jim Meyering
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
---
HACKING | 9 +
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/HACKING b/HACKING
index 47
From: Jim Meyering
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.
Acked-by: Aneesh Kumar K.V
Signed-off-by: Jim Meyering
---
hw/9pfs/virtio-9p-synth.c
From: Jim Meyering
Acked-by: Kevin Wolf
Signed-off-by: Jim Meyering
---
block/qcow2.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/block/qcow2.c b/block/qcow2.c
index c2e49cd..6d34f1a 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -994,6 +994,7 @@ int qcow2_update_header
From: Jim Meyering
Use g_strdup rather than strdup, because the sole caller
(qdev_get_fw_dev_path_helper) assumes it gets non-NULL, and dereferences
it. Besides, in that caller, the allocated buffer is already freed with
g_free, so it's better to allocate with a matching g_strdup.
In one
From: Jim Meyering
* 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 that.
* sd_snapshot_create: Add
From: Jim Meyering
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 of ifr_name consistent
From: Jim Meyering
In all of these cases, 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.
Acked-by: Aneesh Kumar K.V
Signed-off-by: Jim Meyering
---
hw/9pfs/virtio-9p
From: Jim Meyering
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.
Acked-by: David Gibson
Signed-off-by: Jim Meyerin
From: Jim Meyering
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(slave->
From: Jim Meyering
This avoids a NULL-deref upon strdup failure.
Also update matching free to g_free.
Signed-off-by: Jim Meyering
---
target-sparc/cpu.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/target-sparc/cpu.c b/target-sparc/cpu.c
index 7ac6bdb..1e31318
From: Jim Meyering
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
---
target-ppc/kvm.c | 2 +-
1 file changed, 1 insertion(+),
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 Meyering wrote:
>>>>>>From 40
From: Jim Meyering
Signed-off-by: Jim Meyering
---
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,
}
if (kernel_cmdline
From: Jim Meyering
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
Signed-off-by: Jim Meyering
---
block.c | 5 +++--
1 file changed, 3
Anthony Liguori wrote:
> On 05/09/2012 10:12 PM, Jim Meyering wrote:
>> Peter Maydell wrote:
>>> On 9 May 2012 15:01, Jim Meyering wrote:
>>>> From 402100deb7e27b1d7ac619ebac963f861fae91b0 Mon Sep 17 00:00:00 2001
>>>> From: Jim Meyering
>>>
-2652.
http://bugzilla.redhat.com/CVE-2012-2652
Signed-off-by: Jim Meyering
---
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 -
block/vvfat.c
Peter Maydell wrote:
> On 16 May 2012 14:08, Jim Meyering wrote:
>> From: Jim Meyering
>>
>> Use g_malloc/g_free in place of malloc/free.
>>
>> Signed-off-by: Jim Meyering
>> ---
>> softmmu-semi.h | 6 +++---
>> 1 file changed, 3 insertions(+
Return NULL upon malloc failure.
Signed-off-by: Jim Meyering
---
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
From: Jim Meyering
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 Meyering
Peter Maydell wrote:
> On 22 May 2012 10:50, Jim Meyering wrote:
>> From: Jim Meyering
>
> 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. V3 is on its way.
Peter Maydell wrote:
> On 21 May 2012 21:10, Jim Meyering wrote:
>> Peter Maydell wrote:
>>> On 21 May 2012 20:51, Jim Meyering wrote:
>>>> From: Jim Meyering
>>>>
>>>>
>>>> Signed-off-by: Jim Meyering
>>>&g
From: Jim Meyering
Add comments so no one else will be tempted to reduce the scope
of this global variable.
Signed-off-by: Jim Meyering
---
tcg/tcg.c | 10 +++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/tcg/tcg.c b/tcg/tcg.c
index ab589c7..2793fa6 100644
--- a/tcg
From: Jim Meyering
Signed-off-by: Jim Meyering
---
envlist.c | 256 +++---
1 file changed, 128 insertions(+), 128 deletions(-)
diff --git a/envlist.c b/envlist.c
index f2303cd..e44889b 100644
--- a/envlist.c
+++ b/envlist.c
@@ -8,13
From: Jim Meyering
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 --
1 file changed
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 -
From: Jim Meyering
Signed-off-by: Jim Meyering
---
envlist.c | 256 +++---
1 file changed, 128 insertions(+), 128 deletions(-)
diff --git a/envlist.c b/envlist.c
index f2303cd..be0addb 100644
--- a/envlist.c
+++ b/envlist.c
@@ -8,13
From: Jim Meyering
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 Meyering
From: Jim Meyering
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
envlist.c: handle strdup
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 repla
From: Jim Meyering
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 Meyering
From: Jim Meyering
Signed-off-by: Jim Meyering
---
envlist.c | 256 +++---
1 file changed, 128 insertions(+), 128 deletions(-)
diff --git a/envlist.c b/envlist.c
index f2303cd..1d98108 100644
--- a/envlist.c
+++ b/envlist.c
@@ -8,13
From: Jim Meyering
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
From: Jim Meyering
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
---
arm-dis.c | 8 ++---
c
From: Jim Meyering
Signed-off-by: Jim Meyering
---
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 @@ enum
Many instructions are short
Peter Maydell wrote:
> On 21 May 2012 20:51, Jim Meyering wrote:
>> From: Jim Meyering
>>
>>
>> Signed-off-by: Jim Meyering
>> ---
>> tcg/tcg.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/tcg/tcg.c b/tcg/
From: Jim Meyering
Signed-off-by: Jim Meyering
---
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-emulated.c
+++ b/hw/ccid-card-emulated.c
From: Jim Meyering
Signed-off-by: Jim Meyering
---
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 struct PCIBonitoState
} PCIBonitoState
From: Jim Meyering
Declare arg_table to be "static const", and adjust the two users
to also be const.
Signed-off-by: Jim Meyering
---
linux-user/main.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/linux-user/main.c b/linux-user/main.c
index 191b750..cc5b
From: Jim Meyering
Signed-off-by: Jim Meyering
---
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
@@ -2014,7 +2014,7 @@ static
From: Jim Meyering
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
---
alpha-dis.c | 26 +-
1
From: Jim Meyering
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
---
alpha-dis.c | 26 +-
1
From: Jim Meyering
Signed-off-by: Jim Meyering
---
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 __jit_debug_register_code(void)
/* Must statically
From: Jim Meyering
Signed-off-by: Jim Meyering
---
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 __jit_debug_register_code(void)
/* Must statically
From: Jim Meyering
Signed-off-by: Jim Meyering
---
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
+++ b/hw/ccid-card-passthru.c
@@ -27,7
From: Jim Meyering
Signed-off-by: Jim Meyering
---
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
+++ b/hw/ccid-card-passthru.c
@@ -27,7
From: Jim Meyering
Following up on discussion here,
http://marc.info/?t=13375948768&r=1&w=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 c
Blue Swirl wrote:
> On Mon, May 21, 2012 at 6:10 PM, Jim Meyering wrote:
>> Blue Swirl wrote:
>>> On Mon, May 21, 2012 at 10:03 AM, Jim Meyering wrote:
>>>> From: Jim Meyering
>>>>
>>>> I noticed this commit,
>>>>
>>
Blue Swirl wrote:
> On Mon, May 21, 2012 at 10:03 AM, Jim Meyering wrote:
>> From: Jim Meyering
>>
>> I noticed this commit,
>>
>> virtio-pci: add missing 'static'
>>
>> which made this change:
>>
>> > -const MemoryReg
Kevin Wolf wrote:
> Am 16.05.2012 15:07, schrieb Jim Meyering:
>> From: Jim Meyering
>>
>>
>> Signed-off-by: Jim Meyering
>> ---
>> block/qcow2.c | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/block/qcow2.c b/block/qcow2.
Signed-off-by: Jim Meyering
---
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 @@ int
Blue Swirl wrote:
> On Tue, May 15, 2012 at 1:04 PM, wrote:
>> From: Jim Meyering
>>
>> 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 faili
From: Jim Meyering
Signed-off-by: Jim Meyering
---
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 @@ QemuOptsList qemu_spice_opts
1 - 100 of 159 matches
Mail list logo