[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v5 07/10] linux-user: check return value of mall
From: |
Riku Voipio |
Subject: |
Re: [Qemu-devel] [PATCH v5 07/10] linux-user: check return value of malloc() |
Date: |
Tue, 12 Aug 2014 10:34:59 +0300 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Mon, Aug 11, 2014 at 04:53:06PM +0800, zhanghailiang wrote:
> Signed-off-by: zhanghailiang <address@hidden>
Acked-by: Riku Voipio <address@hidden>
> ---
> linux-user/syscall.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index a50229d..8e5ccf1 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -2870,6 +2870,10 @@ static inline abi_long do_msgsnd(int msqid, abi_long
> msgp,
> if (!lock_user_struct(VERIFY_READ, target_mb, msgp, 0))
> return -TARGET_EFAULT;
> host_mb = malloc(msgsz+sizeof(long));
> + if (!host_mb) {
> + unlock_user_struct(target_mb, msgp, 0);
> + return -TARGET_ENOMEM;
> + }
> host_mb->mtype = (abi_long) tswapal(target_mb->mtype);
> memcpy(host_mb->mtext, target_mb->mtext, msgsz);
> ret = get_errno(msgsnd(msqid, host_mb, msgsz, msgflg));
> --
> 1.7.12.4
>
>
- [Qemu-devel] [PATCH v5 05/10] util/path: Use the GLib memory allocation routines, (continued)
- [Qemu-devel] [PATCH v5 05/10] util/path: Use the GLib memory allocation routines, zhanghailiang, 2014/08/11
- [Qemu-devel] [PATCH v5 08/10] tests/bios-tables-test: check the value returned by fopen(), zhanghailiang, 2014/08/11
- [Qemu-devel] [PATCH v5 02/10] monitor: fix access freed memory, zhanghailiang, 2014/08/11
- [Qemu-devel] [PATCH v5 01/10] l2cap: fix access freed memory, zhanghailiang, 2014/08/11
- [Qemu-devel] [PATCH v5 10/10] block/vvfat: fix setbuf stream parameter may be NULL, zhanghailiang, 2014/08/11
- [Qemu-devel] [PATCH v5 09/10] tcg: check return value of fopen(), zhanghailiang, 2014/08/11
- [Qemu-devel] [PATCH v5 07/10] linux-user: check return value of malloc(), zhanghailiang, 2014/08/11
- Re: [Qemu-devel] [PATCH v5 07/10] linux-user: check return value of malloc(),
Riku Voipio <=