From c6cdb6c16da3eadcbeb1b6ba4fbef8cde23e5751 Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Tue, 23 Oct 2012 13:02:58 +0200 Subject: [PATCH] CData: Check both arguments of CData_update() for NULL. --- src/cdata.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/cdata.c b/src/cdata.c index c4f9340..7ee14e6 100644 --- a/src/cdata.c +++ b/src/cdata.c @@ -366,6 +366,9 @@ cdata_update(PG_FUNCTION_ARGS) if (! data) PG_RETURN_CDATA_P(update); + if (! update) + PG_RETURN_CDATA_P(data); + if ((data->cf != update->cf) && (update->val_num > 1)) ereport(ERROR, ( errcode(ERRCODE_INVALID_PARAMETER_VALUE), -- 2.30.2