summaryrefslogtreecommitdiff
path: root/pkgs/development/perl-modules/JSON-XS-CVE-2025-40928.patch
blob: f1d258c12a3d0f87decc7a4ce2e54df1c57f675f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
--- a/XS.xs	2025-09-06 08:34:51.376455632 -0300
+++ b/XS.xs	2025-09-06 08:35:30.725873619 -0300
@@ -253,16 +253,16 @@
   // if we recurse too deep, skip all remaining digits
   // to avoid a stack overflow attack
   if (expect_false (--maxdepth <= 0))
-    while (((U8)*s - '0') < 10)
+    while ((U8)(*s - '0') < 10)
       ++s;
 
   for (;;)
     {
-      U8 dig = (U8)*s - '0';
+      U8 dig = *s - '0';
 
       if (expect_false (dig >= 10))
         {
-          if (dig == (U8)((U8)'.' - (U8)'0'))
+          if (dig == (U8)('.' - '0'))
             {
               ++s;
               json_atof_scan1 (s, accum, expo, 1, maxdepth);
@@ -282,7 +282,7 @@
               else if (*s == '+')
                 ++s;
 
-              while ((dig = (U8)*s - '0') < 10)
+              while ((dig = (U8)(*s - '0')) < 10)
                 exp2 = exp2 * 10 + *s++ - '0';
 
               *expo += neg ? -exp2 : exp2;