--- parser3/src/classes/table.C 2024/12/11 15:46:38 1.378 +++ parser3/src/classes/table.C 2026/01/08 21:13:03 1.382 @@ -26,7 +26,7 @@ #include "pa_array.h" #include "pa_varray.h" -volatile const char * IDENT_TABLE_C="$Id: table.C,v 1.378 2024/12/11 15:46:38 moko Exp $"; +volatile const char * IDENT_TABLE_C="$Id: table.C,v 1.382 2026/01/08 21:13:03 moko Exp $"; // class @@ -849,11 +849,11 @@ static void table_row_to_hash(Table::ele for(Array_iterator i(*info->value_fields); i; ) { size_t value_field=i.next(); if(value_fieldcount()) - hash.put(columns ? *columns->get(value_field) : String(pa_uitoa(value_field)), new VString(*row->get(value_field))); + hash.put(columns ? *columns->get(value_field) : String::Body::uitoa(value_field), new VString(*row->get(value_field))); } } else { // all fields for(size_t index=0; indexcount(); index++) { - hash.put(columns && index < columns->count() ? *columns->get(index) : String(pa_uitoa(index)), new VString(*row->get(index))); + hash.put(columns && index < columns->count() ? *columns->get(index) : String::Body::uitoa(index), new VString(*row->get(index))); } } exist=info->hash->put_dont_replace(*key, vhash); @@ -1071,7 +1071,7 @@ static void _cells(Request& r, MethodPar size_t row_size=self_table[self_table.current()]->count(); // number of columns in current row if(params.count()){ - int limit=params.as_int(params.count()-1, "offset must be expression", r); + int limit=params.as_int(params.count()-1, "limit must be expression", r); if(limit<0) limit=0; if((size_t)limit pa_array_limit) + throw Exception(PARSER_RUNTIME, 0, "table size (%d) exceeds limit $MAIN:LIMITS.max_array_size (%d)", table.count(), pa_array_limit); } static void _insert(Request& r, MethodParams& params) { @@ -1320,6 +1323,9 @@ static void _insert(Request& r, MethodPa } else { table.insert(table.current(), row_from_string(r, params[0])); } + + if(table.count() > pa_array_limit) + throw Exception(PARSER_RUNTIME, 0, "table size (%d) exceeds limit $MAIN:LIMITS.max_array_size (%d)", table.count(), pa_array_limit); } static void _delete(Request& r, MethodParams&) { @@ -1439,7 +1445,7 @@ void unmarshal_bind_updates(HashStringVa if(ph->is_null) value=VVoid::get(); else - value=new VString(*new String(ph->value, String::L_TAINTED)); + value=new VString(ph->value); hash.put(ph->name, value); } }