Sfoglia il codice sorgente

File scan now uses bytesMatch() instead of signatureMatches(), reducing call stack size

n1474335 6 anni fa
parent
commit
cd0c86e0d6
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      src/core/lib/FileType.mjs

+ 1 - 1
src/core/lib/FileType.mjs

@@ -133,7 +133,7 @@ export function scanForFileTypes(buf) {
             sigs.forEach(sig => {
             sigs.forEach(sig => {
                 let pos = 0;
                 let pos = 0;
                 while ((pos = locatePotentialSig(buf, sig, pos)) >= 0) {
                 while ((pos = locatePotentialSig(buf, sig, pos)) >= 0) {
-                    if (signatureMatches(sig, buf, pos)) {
+                    if (bytesMatch(sig, buf, pos)) {
                         foundFiles.push({
                         foundFiles.push({
                             offset: pos,
                             offset: pos,
                             fileDetails: filetype
                             fileDetails: filetype