Re: Possible NULL pointer deferenced (src/interfaces/libpq/fe-exec.c(line 563) - Mailing list pgsql-hackers

From Ranier Vilela
Subject Re: Possible NULL pointer deferenced (src/interfaces/libpq/fe-exec.c(line 563)
Date
Msg-id CAEudQApdL+znP4xAdPieKGsNa+qzuG+bMJii9Ats6n9xbaTfWQ@mail.gmail.com
Whole thread Raw
In response to Re: Possible NULL pointer deferenced (src/interfaces/libpq/fe-exec.c (line 563)  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Em dom., 21 de jun. de 2020 às 02:16, Tom Lane <tgl@sss.pgh.pa.us> escreveu:
Ranier Vilela <ranier.vf@gmail.com> writes:
> The res->curBlock pointer possibly, can be NULL here (line 563).

No, it can't.

To get to that line, nBytes has to be > 0, which means res->spaceLeft
has to be > 0, which cannot happen while res->curBlock is NULL.
Hi Tom, thanks for answer.

regards,
Ranier Vilela

pgsql-hackers by date:

Previous
From: Josef Šimánek
Date:
Subject: Re: [PATCH] Initial progress reporting for COPY command
Next
From: ilmari@ilmari.org (Dagfinn Ilmari Mannsåker)
Date:
Subject: Re: [PATCH] Missing links between system catalog documentation pages