diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2017-10-04 01:58:21 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2017-10-31 19:03:54 +0100 |
commit | 0e91d138a30a85eedceb3dbfd28b478a83232979 (patch) | |
tree | bfa5a60d79a23678f0aad1478ed34e1e17dd0408 /linux | |
parent | 1a440cd7dc100f934f579735cb4f45c9ef58dde0 (diff) | |
download | gnumach-0e91d138a30a85eedceb3dbfd28b478a83232979.tar.gz gnumach-0e91d138a30a85eedceb3dbfd28b478a83232979.tar.bz2 gnumach-0e91d138a30a85eedceb3dbfd28b478a83232979.zip |
linux-block: Fix calling vm_map_copy_discard on uninitialized variable
This happens if passed count is 0.
Reported by Richard Braun.
* linux/dev/glue/block.c (device_write): Set copy variable before
vm_map_copy_discard() is called.
Diffstat (limited to 'linux')
-rw-r--r-- | linux/dev/glue/block.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/linux/dev/glue/block.c b/linux/dev/glue/block.c index c1d922b6..a8fa9153 100644 --- a/linux/dev/glue/block.c +++ b/linux/dev/glue/block.c @@ -1303,7 +1303,7 @@ device_write (void *d, ipc_port_t reply_port, int resid, amt, i; int count = (int) orig_count; io_return_t err = 0; - vm_map_copy_t copy; + vm_map_copy_t copy = (vm_map_copy_t) data; vm_offset_t addr, uaddr; vm_size_t len, size; struct block_data *bd = d; @@ -1327,7 +1327,6 @@ device_write (void *d, ipc_port_t reply_port, } resid = count; - copy = (vm_map_copy_t) data; uaddr = copy->offset; /* Allocate a kernel buffer. */ |