Re: [PATCH] posix: Remove unnecessary overflow check in wordexp (BZ 34090)

Adhemerval Zanella Netto <[email protected]>
Newsgroups gmane.comp.lib.glibc.alpha
Organization Linaro
Message-ID <[email protected]>

On 13/08/26 09:40, Andreas Schwab wrote:
> On Aug 13 2026, Adhemerval Zanella wrote:
> 
>> @@ -2269,16 +2268,14 @@ wordexp (const char *words, wordexp_t *pwordexp, int flags)
>>      {
>>        /* WRDE_APPEND with an existing word list: duplicate the array so that
>>  	 realloc during parsing does not invalidate the caller's pointer.  The
>> -	 strings themselves are shared.  */
>> -      size_t num_p;
>> -      char **dup;
>> -      if (INT_ADD_WRAPV (pwordexp->we_offs, pwordexp->we_wordc, &num_p)
>> -	  || INT_ADD_WRAPV (num_p, 1, &num_p))
>> -	return WRDE_NOSPACE;
>> -      dup = __libc_reallocarray (NULL, num_p, sizeof *dup);
>> +	 strings themselves are shared an the array already holds
> 
>                                        and
> 

Ack, ok with this fix?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.