]> git.kaiwu.me - njs.git/commitdiff
Fixed Buffer.prototype.indexOf() on 32bits platforms.
authorDmitry Volyntsev <xeioex@nginx.com>
Thu, 10 Oct 2024 23:33:13 +0000 (16:33 -0700)
committerDmitry Volyntsev <xeioexception@gmail.com>
Fri, 11 Oct 2024 01:27:18 +0000 (18:27 -0700)
src/njs_buffer.c
src/qjs_buffer.c

index 2f0fc620d69e3bf4762a8b6b03f796eac5975dd0..3ce1b90a362928bf7dd1b285425537734509928c 100644 (file)
@@ -2198,7 +2198,7 @@ encoding:
             }
 
         } else {
-            to -= str.length - 1;
+            to -= (int64_t) str.length - 1;
 
             if (from > to) {
                 goto done;
index 02618387748676f0a6be3877bd052504c38f1616..9f451e26f0b6a760ea9cf674ae4e3ff3133c68a1 100644 (file)
@@ -1071,7 +1071,7 @@ encoding:
         }
 
     } else {
-        to -= str.length - 1;
+        to -= (int64_t) str.length - 1;
 
         if (from > to) {
             goto done;