Fix possible dereference null pointer (PQprint) - Mailing list pgsql-hackers

From Ranier Vilela
Subject Fix possible dereference null pointer (PQprint)
Date
Msg-id CAEudQAquFQHYOfm9JLpS6LtA3_xcnRZj+sU9zbzPEF2bLmj+Rw@mail.gmail.com
Whole thread Raw
Responses Re: Fix possible dereference null pointer (PQprint)
List pgsql-hackers
Hi.

In the function *PQprint*, the variable po->fieldName
can be NULL.
See the checks a few lines up.

for (numFieldName = 0;
po->fieldName && po->fieldName[numFieldName];
numFieldName++)

So, I think that must be checked, when used,
in the loop below.

best regards,
Ranier Vilela
Attachment

pgsql-hackers by date:

Previous
From: Ranier Vilela
Date:
Subject: Fix use of possible uninitialized variable retval (src/pl/plpgsql/src/pl_handler.c)
Next
From: Alexander Lakhin
Date:
Subject: Test 031_recovery_conflict fails when a conflict counted twice