Обсуждение: Static analysis fix request

Поиск
Список
Период
Сортировка

Static analysis fix request

От
Pavel Raiskup
Дата:
* Attached fix for overrun.  This is imo worth fixing.

* Attached added gcc & Coverity warnings (added between 9.2.1 and 9.3.1)

Pavel

Вложения

Re: Static analysis fix request

От
Heikki Linnakangas
Дата:
On 01/06/2014 11:00 AM, Pavel Raiskup wrote:
> * Attached fix for overrun.  This is imo worth fixing.
>
> * Attached added gcc & Coverity warnings (added between 9.2.1 and 9.3.1)

Ironically, I changed the code the way it is now, per previous static
analyzer report. It was off by even more before.

And I think it's still wrong :-). The code that follows expects the
prefix[] array to be terminated by a NULL entry.

That code is really difficult to read, and hence difficult to get
correct. Since we've already been burned twice by it, let's make it less
error-prone. How about the attached? Does that look correct to you?

(Perhaps we should just rip out the prefix stuff, though. It's only
there to support pre-7.3 servers)

- Heikki

Вложения

Re: Static analysis fix request

От
Pavel Raiskup
Дата:
> That code is really difficult to read, and hence difficult to get
> correct. Since we've already been burned twice by it, let's make it less
> error-prone. How about the attached? Does that look correct to you?

Thanks for looking at this, I don't see a problem in your patch; the code
should not change behavior (except not touching outside array borders).



Re: Static analysis fix request

От
Heikki Linnakangas
Дата:
On 01/06/2014 04:48 PM, Pavel Raiskup wrote:
>> That code is really difficult to read, and hence difficult to get
>> correct. Since we've already been burned twice by it, let's make it less
>> error-prone. How about the attached? Does that look correct to you?
>
> Thanks for looking at this, I don't see a problem in your patch; the code
> should not change behavior (except not touching outside array borders)

Ok, committed. Thanks!

- Heikki