Possible NULL pointer deferenced (src/interfaces/libpq/fe-exec.c(line 563)

Поиск
Список
Период
Сортировка
От Ranier Vilela
Тема Possible NULL pointer deferenced (src/interfaces/libpq/fe-exec.c(line 563)
Дата
Msg-id CAEudQAr7RQZkLbVQE3J91O2KbLFtggLDbnZvr+QmNUHT2+z1Ng@mail.gmail.com
обсуждение исходный текст
Ответы Re: Possible NULL pointer deferenced (src/interfaces/libpq/fe-exec.c (line 563)  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Hi Mark,
please, can you take a look?

This possible bug was appeared before, see at:

The trap still persist, in HEAD see:

src/interfaces/libpq/fe-exec.c (line 563)
/* If there's enough space in the current block, no problem. */
if (nBytes <= (size_t) res->spaceLeft)
{
   space = res->curBlock->space + res->curOffset;
   res->curOffset += nBytes;
   res->spaceLeft -= nBytes;

   return space;
}

The res->curBlock pointer possibly, can be NULL here (line 563).

See at:
src/interfaces/libpq/fe-exec.c (line 585)
if (res->curBlock)

The path is res->curBlock be NULL and res->spaceLeft > nBytes.

If res->curBlock it not can be NULL, inside pqResultAlloc function, why is verified against NULL at line 585?

regards,
Ranier Vilela

В списке pgsql-hackers по дате отправления:

Предыдущее
От: vignesh C
Дата:
Сообщение: Re: Include access method in listTables output
Следующее
От: Amit Kapila
Дата:
Сообщение: Re: git.postgresql.org ok?