Code

CData: Check both arguments of CData_update() for NULL.
authorSebastian Harl <sh@tokkee.org>
Tue, 23 Oct 2012 11:02:58 +0000 (13:02 +0200)
committerSebastian Harl <sh@tokkee.org>
Tue, 23 Oct 2012 11:02:58 +0000 (13:02 +0200)
src/cdata.c

index c4f934034fcad12153546f500a649a42b69e9526..7ee14e643b9d8081997073e4188b2fca79c58c00 100644 (file)
@@ -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),