You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add range check for numbers to prevent DynamoDB overflow
Numbers in expressions could grow arbitrarily large via parsing or arithmetic,
causing persist failures when stored as DynamoDB N type (max 38 digits). This
adds a range check (max 36 significant digits, magnitude ±1E100) enforced at
all number creation points.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
"__default__": types.NewXNumberFromInt(123), // should use default
67
76
"foo": types.NewXNumberFromInt(234),
68
77
}), types.NewXNumberFromInt(123), 123, false},
69
-
{types.NewXText("12345678901234567890"), types.RequireXNumberFromString("12345678901234567890"), 0, true}, // out of int range
70
-
{types.NewXText("1E100"), types.XNumberZero, 0, true}, // scientific notation not allowed
71
-
{types.NewXText("1e100"), types.XNumberZero, 0, true}, // scientific notation not allowed
78
+
{types.NewXText("12345678901234567890"), types.RequireXNumberFromString("12345678901234567890"), 0, true}, // out of int range
79
+
{types.NewXText("123456789012345678901234567890123456"), types.RequireXNumberFromString("123456789012345678901234567890123456"), 0, true}, // 36 digits, ok as number but out of int range
80
+
{types.NewXText("1234567890123456789012345678901234567"), types.XNumberZero, 0, true}, // 37 digits, too many
81
+
{types.NewXText("1E100"), types.XNumberZero, 0, true}, // scientific notation not allowed
82
+
{types.NewXText("1e100"), types.XNumberZero, 0, true}, // scientific notation not allowed
0 commit comments