Skip to content

Maximum call stack size exceed in core.js #5

@max-lt

Description

@max-lt

Line 226 of core.js : crash sometime for obscur reasons
(with chromium 50.0.2661.75 (64-bit))
(not with FireFox 46.0)
solved by changing

219             } else if (thatWords.length > 0xffff) {
220                 // Copy one word at a time
221                 for (var i = 0; i < thatSigBytes; i += 4) {
222                     thisWords[(thisSigBytes + i) >>> 2] = thatWords[i >>> 2];
223                 }
224             } else {
225                 // Copy all words at once
226                 thisWords.push.apply(thisWords, thatWords);
227             }

by

219             } else {
220                 // Copy one word at a time
221                 for (var i = 0; i < thatSigBytes; i += 4) {
222                     thisWords[(thisSigBytes + i) >>> 2] = thatWords[i >>> 2];
223                 }
224             }
Error : Uncaught RangeError: Maximum call stack size exceeded  
  C_lib.WordArray.Base.extend.concat  
  C_lib.BufferedBlockAlgorithm.Base.extend._append  
  C_lib.Hasher.BufferedBlockAlgorithm.extend.finalize  
  (anonymous function)  
  hashChunk  
  (anonymous function)

EDIT : fix can be done by lowering the word limit : passed from Oxffff to 0xfff

219             } else if (thatWords.length > 0xfff) {
220                 // Copy one word at a time
221                 for (var i = 0; i < thatSigBytes; i += 4) {
222                     thisWords[(thisSigBytes + i) >>> 2] = thatWords[i >>> 2];
223                 }
224             } else {
225                 // Copy all words at once
226                 thisWords.push.apply(thisWords, thatWords);
227             }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions