Hi all,
Coverity is pointing out $subject, with the following stuff in gbt_var_same():
GBT_VARKEY *t1 = (GBT_VARKEY *) DatumGetPointer(d1);
GBT_VARKEY *t2 = (GBT_VARKEY *) DatumGetPointer(d2);
GBT_VARKEY_R r1,
r2;
r1 = gbt_var_key_readable(t1); <= t1 dereferenced
r2 = gbt_var_key_readable(t2); <= t2 dereferenced
if (t1 && t2)
result = ((*tinfo->f_cmp) (r1.lower, r2.lower,
collation) == 0 &&
(*tinfo->f_cmp) (r1.upper, r2.upper,
collation) == 0);
else
result = (t1 == NULL && t2 == NULL); <= Coverity complains here
return result;
As Heikki pointed me out on IM, the lack of crash report in this area,
as well as similar coding style in cube/ seem to be sufficient
arguments to simply remove those NULL checks instead of doing more
solid checks on them. Patch is attached.
Regards,
--
Michael