Changeset: 36cea9050e68 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=36cea9050e68
Modified Files:
        sql/backends/monet5/sql_round_impl.h
Branch: Jun2016
Log Message:

Prevent out-of-bounds array access.


diffs (12 lines):

diff --git a/sql/backends/monet5/sql_round_impl.h 
b/sql/backends/monet5/sql_round_impl.h
--- a/sql/backends/monet5/sql_round_impl.h
+++ b/sql/backends/monet5/sql_round_impl.h
@@ -296,6 +296,8 @@ str_2dec(TYPE *res, const str *val, cons
        }
        if (digits < 0)
                throw(SQL, STRING(TYPE), "decimal (%s) doesn't have format 
(%d.%d)", *val, *d, *sc);
+       if (*d < 0 || *d >= (int) (sizeof(scales) / sizeof(scales[0])))
+               throw(SQL, STRING(TYPE), "decimal (%s) doesn't have format 
(%d.%d)", *val, *d, *sc);
 
        value = decimal_from_str(s, &end);
        if (*s == '+' || *s == '-')
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to