[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wine-devel
Subject:    Re: [PATCH] ntdll: Complete error case in get_initial_environment
From:       "Esme Povirk (any/all)" <esme () codeweavers ! com>
Date:       2022-09-06 16:17:50
Message-ID: CAAFPtVQpwXzCidaVVMWQDCHV+Fmq_xhESS58RmjXBmcw_hSdLQ () mail ! gmail ! com
[Download RAW message or body]

Patches are no longer picked up from wine-devel. You'll need to create
a merge request at https://gitlab.winehq.org/. See
https://wiki.winehq.org/Submitting_Patches for more detailed
instructions.

--
https://my.pronouns.page/are/any



On Mon, Sep 5, 2022 at 2:06 AM Gerald Pfeifer <gerald@pfeifer.com> wrote:
>
> GCC 12 (rightfully) would warn
> dlls/ntdll/unix/env.c:1910:12: warning: 'env_pos' may be used uninitialized
>
> Signed-off-by: Gerald Pfeifer <gerald@pfeifer.com>
> ---
>  dlls/ntdll/unix/env.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/dlls/ntdll/unix/env.c b/dlls/ntdll/unix/env.c
> index 105038a34cb..cbbfb99f4b3 100644
> --- a/dlls/ntdll/unix/env.c
> +++ b/dlls/ntdll/unix/env.c
> @@ -920,7 +920,11 @@ static WCHAR *get_initial_environment( SIZE_T *pos, SIZE_T *size )
>      *size = 1;
>      for (e = main_envp; *e; e++) *size += strlen(*e) + 1;
>
> -    if (!(env = malloc( *size * sizeof(WCHAR) ))) return NULL;
> +    if (!(env = malloc( *size * sizeof(WCHAR) )))
> +    {
> +        *pos = 0;
> +        return NULL;
> +    }
>      ptr = env;
>      end = env + *size - 1;
>      for (e = main_envp; *e && ptr < end; e++)
> --
> 2.34.1
>
>


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic