Revision a6f79cc9 linux-user/syscall.c

b/linux-user/syscall.c
4949 4949
            abi_ulong guest_envp;
4950 4950
            abi_ulong addr;
4951 4951
            char **q;
4952
            int total_size = 0;
4952 4953

  
4953 4954
            argc = 0;
4954 4955
            guest_argp = arg2;
......
4980 4981
                    break;
4981 4982
                if (!(*q = lock_user_string(addr)))
4982 4983
                    goto execve_efault;
4984
                total_size += strlen(*q) + 1;
4983 4985
            }
4984 4986
            *q = NULL;
4985 4987

  
......
4991 4993
                    break;
4992 4994
                if (!(*q = lock_user_string(addr)))
4993 4995
                    goto execve_efault;
4996
                total_size += strlen(*q) + 1;
4994 4997
            }
4995 4998
            *q = NULL;
4996 4999

  
5000
            /* This case will not be caught by the host's execve() if its
5001
               page size is bigger than the target's. */
5002
            if (total_size > MAX_ARG_PAGES * TARGET_PAGE_SIZE) {
5003
                ret = -TARGET_E2BIG;
5004
                goto execve_end;
5005
            }
4997 5006
            if (!(p = lock_user_string(arg1)))
4998 5007
                goto execve_efault;
4999 5008
            ret = get_errno(execve(p, argp, envp));

Also available in: Unified diff