PostgreSQL Bugs

Collected from the PG bugs email list.

Bug ID16190
PG Version12.1
OSLinux
Opened2020-01-06 03:39:36+00
Reported byJian Zhang
StatusNew

Body of first available message related to this bug follows.

The following bug has been logged on the website:

Bug reference:      16190
Logged by:          Jian Zhang
Email address:      (redacted)
PostgreSQL version: 12.1
Operating system:   Linux
Description:        

We checked the code in file “refint.c” and there is one error occurring in
line 636. This error is caused by the usage of pointer with NULL value. The
code in this line is “newp->ident = strdup(ident);” The pointer “newp” is
defined by the code in line 615 as “EPlan *newp;” and initialized by the
code in line 628 as “newp = *eplan + i;” or in line 632 as “newp = *eplan =
(EPlan *) malloc(sizeof(EPlan));” according to different conditions. In the
first condition, the “*eplan” is valued by the code “*eplan = (EPlan *)
realloc(*eplan, (i + 1) * sizeof(EPlan));” in line 627. We found the code
hasn’t checked if the process “realloc” and “malloc” are success or not
which directly define the value of “*eplan”. The program should check the
effectiveness of the return value of function “realloc” and “malloc” to
avoid this error.

Messages

DateAuthorSubject
2020-01-06 03:39:36+00PG Bug reporting formBUG #16190: The usage of NULL pointer in refint.c
2020-01-06 05:18:00+00Michael PaquierRe: BUG #16190: The usage of NULL pointer in refint.c
2020-01-06 06:21:35+00Tom LaneRe: BUG #16190: The usage of NULL pointer in refint.c
2020-01-06 06:49:18+00Michael PaquierRe: BUG #16190: The usage of NULL pointer in refint.c
2020-01-06 17:44:43+00Andres FreundRe: BUG #16190: The usage of NULL pointer in refint.c
2020-01-07 01:27:41+00Michael PaquierRe: BUG #16190: The usage of NULL pointer in refint.c
2020-01-07 02:12:05+00Tom LaneRe: BUG #16190: The usage of NULL pointer in refint.c
2020-01-07 02:26:54+00Andres FreundRe: BUG #16190: The usage of NULL pointer in refint.c
2020-01-07 06:44:12+00Michael PaquierRe: BUG #16190: The usage of NULL pointer in refint.c
2020-01-07 06:45:08+00Andres FreundRe: BUG #16190: The usage of NULL pointer in refint.c
2020-01-12 13:47:50+00Michael PaquierRe: BUG #16190: The usage of NULL pointer in refint.c