Changeset: 897f9ce1e21f for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/897f9ce1e21f Modified Files: sql/backends/monet5/sql_time.c Branch: Dec2023 Log Message:
Do range check properly, i.e. not with assert. Fixes #7562. diffs (13 lines): diff --git a/sql/backends/monet5/sql_time.c b/sql/backends/monet5/sql_time.c --- a/sql/backends/monet5/sql_time.c +++ b/sql/backends/monet5/sql_time.c @@ -951,7 +951,8 @@ month_interval_str_imp(int *ret, const c lng upcast; if (interval_from_str(next, d, sk, &upcast) < 0) return createException(SQL, "batcalc.month_interval_str", SQLSTATE(42000) "Wrong format (%s)", next); - assert((lng) GDK_int_min <= upcast && upcast <= (lng) GDK_int_max); + if (upcast < (lng) GDK_int_min || upcast > (lng) GDK_int_max) + throw(SQL, "batcalc.month_interval_str", SQLSTATE(22003) "value out of range"); *ret = (int) upcast; return MAL_SUCCEED; } _______________________________________________ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org