Fix possible dereference null pointer (PQprint)

From: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
To: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Fix possible dereference null pointer (PQprint)
Date: 2024-05-27 14:52:20
Message-ID: CAEudQAquFQHYOfm9JLpS6LtA3_xcnRZj+sU9zbzPEF2bLmj+Rw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 Content-Type Size
fix-possible-dereference-null-pointer-PQprint.patch application/octet-stream 535 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Lakhin 2024-05-27 15:00:00 Test 031_recovery_conflict fails when a conflict counted twice
Previous Message Ranier Vilela 2024-05-27 14:31:24 Fix use of possible uninitialized variable retval (src/pl/plpgsql/src/pl_handler.c)