Skip to content

Commit

Permalink
Add check for NULLs in array argument in spherepoly_rad() and spherep…
Browse files Browse the repository at this point in the history
…oly_deg().
  • Loading branch information
esabol committed Oct 31, 2023
1 parent ea57feb commit b6d1705
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/polygon.c
Original file line number Diff line number Diff line change
Expand Up @@ -918,6 +918,14 @@ spherepoly_rad(PG_FUNCTION_ARGS)

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

if (ARR_HASNULL(float_vector))
{
elog( ERROR,
"spherepoly_rad: invalid array has null values"
);
PG_RETURN_NULL();
}

if (np < 6 || np % 2 != 0)
{
elog( ERROR,
Expand Down Expand Up @@ -960,6 +968,14 @@ spherepoly_deg(PG_FUNCTION_ARGS)

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

if (ARR_HASNULL(float_vector))
{
elog( ERROR,
"spherepoly_deg: invalid array has null values"
);
PG_RETURN_NULL();
}

if (np < 6 || np % 2 != 0)
{
elog( ERROR,
Expand Down

0 comments on commit b6d1705

Please sign in to comment.