[PATCH] ecpg: fix missing NULL check in ecpg_store_input
Hi all,
This is my first contribution, so please correct me if anything
is wrong.
During OOM, PGTYPESnumeric_to_asc() can return NULL even on valid
inputs, which can lead to a NULL deref in ecpg_store_input():
```
str = PGTYPESnumeric_to_asc(nval, nval->dscale);
slen = strlen(str);
```
This patch adds the NULL check, matching the surrounding code. This is
unlikely to be hit in practice, so it's more of a hardening than
a real fix.
---
Ilya Gladyshev // foxido.dev
On Tue, Aug 18, 2026 at 10:58:25AM +0000, Gladyshev Ilya wrote:
This patch adds the NULL check, matching the surrounding code. This is
unlikely to be hit in practice, so it's more of a hardening than
a real fix.
Indeed, nice catch. I doubt that it's worth bothering outside of
HEAD for this class of failures due to the fact that they are unlikely
going to be hit in practice. Will do so.
--
Michael