[Piglit] [PATCH 5/9] util: Add piglit_join_paths()

Chad Versace chad.versace at linux.intel.com
Mon Jul 16 11:16:20 PDT 2012


>> +	while (true) {
>> +		const char *p = va_arg(va, const char*);
>> +
>> +		while (*p != 0) {
>> +			if (size_written == buf_size - 1)
>> +				break;
> 
> You should probably return immediately here, otherwise you might set buf[buf_size -1 ] = PIGLIT_PATH_SEP and then write buf[buf_size] = '\0', i.e., overflow.
> 
> But provided bug_size is big enough, this should never happen in practice anyway. Otherwise looks good.
> 
> Jose

Thanks for finding the overflow. I just pushed the series, with the overflow fixed.

-Chad



More information about the Piglit mailing list