Skip to content

Commit d8d7702

Browse files
committed
Merge remote-tracking branch 'refs/remotes/origin/main'
2 parents d167a12 + 6affbbb commit d8d7702

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
--- a/XS.xs 2025-09-06 08:34:51.376455632 -0300
2+
+++ b/XS.xs 2025-09-06 08:35:30.725873619 -0300
3+
@@ -253,16 +253,16 @@
4+
// if we recurse too deep, skip all remaining digits
5+
// to avoid a stack overflow attack
6+
if (expect_false (--maxdepth <= 0))
7+
- while (((U8)*s - '0') < 10)
8+
+ while ((U8)(*s - '0') < 10)
9+
++s;
10+
11+
for (;;)
12+
{
13+
- U8 dig = (U8)*s - '0';
14+
+ U8 dig = *s - '0';
15+
16+
if (expect_false (dig >= 10))
17+
{
18+
- if (dig == (U8)((U8)'.' - (U8)'0'))
19+
+ if (dig == (U8)('.' - '0'))
20+
{
21+
++s;
22+
json_atof_scan1 (s, accum, expo, 1, maxdepth);
23+
@@ -282,7 +282,7 @@
24+
else if (*s == '+')
25+
++s;
26+
27+
- while ((dig = (U8)*s - '0') < 10)
28+
+ while ((dig = (U8)(*s - '0')) < 10)
29+
exp2 = exp2 * 10 + *s++ - '0';
30+
31+
*expo += neg ? -exp2 : exp2;

0 commit comments

Comments
 (0)