[igt-dev] [PATCH i-g-t] tools/intel_reg: fix use-after-free bug in register spec read

Jani Nikula jani.nikula at intel.com
Thu Aug 22 07:33:44 UTC 2019


On Wed, 21 Aug 2019, "Ser, Simon" <simon.ser at intel.com> wrote:
> On Wed, 2019-08-21 at 16:09 +0300, Jani Nikula wrote:
>> e points into the buffer pointer to by p.
>
> Typo: pointed

Whoops. Fixed while applying, thanks for the review.

BR,
Jani.


>
>> 
>> Fixes: dfda0b6aecce ("intel_reg: introduce one intel_reg tool to rule them all")
>> Signed-off-by: Jani Nikula <jani.nikula at intel.com>
>
> Reviewed-by: Simon Ser <simon.ser at intel.com>
>
>> ---
>>  tools/intel_reg_spec.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/tools/intel_reg_spec.c b/tools/intel_reg_spec.c
>> index 0df69b6884de..5ab56ec1a31f 100644
>> --- a/tools/intel_reg_spec.c
>> +++ b/tools/intel_reg_spec.c
>> @@ -233,9 +233,9 @@ static int parse_line(struct reg *reg, const char *line)
>>  			reg->name = p;
>>  		} else if (i == 2) {
>>  			reg->addr = strtoul(p, &e, 16);
>> -			free(p);
>>  			if (*e)
>>  				ret = -1;
>> +			free(p);
>>  		} else if (i == 3) {
>>  			ret = parse_port_desc(reg, p);
>>  			free(p);

-- 
Jani Nikula, Intel Open Source Graphics Center


More information about the igt-dev mailing list