Skip to content

Commit b6d1705

Browse files
committed
Add check for NULLs in array argument in spherepoly_rad() and spherepoly_deg().
1 parent ea57feb commit b6d1705

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/polygon.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -918,6 +918,14 @@ spherepoly_rad(PG_FUNCTION_ARGS)
918918

919919
np = ArrayGetNItems(ARR_NDIM(float_vector), ARR_DIMS(float_vector));
920920

921+
if (ARR_HASNULL(float_vector))
922+
{
923+
elog( ERROR,
924+
"spherepoly_rad: invalid array has null values"
925+
);
926+
PG_RETURN_NULL();
927+
}
928+
921929
if (np < 6 || np % 2 != 0)
922930
{
923931
elog( ERROR,
@@ -960,6 +968,14 @@ spherepoly_deg(PG_FUNCTION_ARGS)
960968

961969
np = ArrayGetNItems(ARR_NDIM(float_vector), ARR_DIMS(float_vector));
962970

971+
if (ARR_HASNULL(float_vector))
972+
{
973+
elog( ERROR,
974+
"spherepoly_deg: invalid array has null values"
975+
);
976+
PG_RETURN_NULL();
977+
}
978+
963979
if (np < 6 || np % 2 != 0)
964980
{
965981
elog( ERROR,

0 commit comments

Comments
 (0)