[PATCH] posix: Fix some null deferences in wordexp [BZ #18096]

Julian Squires julian@cipht.net
Sun Mar 19 13:49:27 GMT 2023


Andreas Schwab <schwab@linux-m68k.org> writes:
> On Mär 18 2023, Julian Squires via Libc-alpha wrote:
>> @@ -1813,7 +1813,7 @@ envsubst:
>>  	    goto success;
>>  
>>  	  value = pattern ? __strdup (pattern) : pattern;
>> -	  free_value = 1;
>> +	  free_value = !!pattern;
>
> What does that fix?

The assertion failure mentioned, where seen_hash is set, triggering the
assertion below, where free_value is set but value is NULL:

  if (seen_hash)
    {
      [...]
      if (free_value)
	{
	  assert (value != NULL);
	  free (value);
	}

-- 
Julian Squires
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 857 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/libc-alpha/attachments/20230319/3db96e3e/attachment.sig>


More information about the Libc-alpha mailing list