Skip to content

Commit

Permalink
fix: security vulnerabillities and a ref to new Buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
soldair committed Jan 16, 2019
1 parent 9636fd6 commit a40c757
Show file tree
Hide file tree
Showing 3 changed files with 1,106 additions and 1,045 deletions.
10 changes: 7 additions & 3 deletions lib/core/galois-field.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
var Buffer = require('../utils/buffer')

var EXP_TABLE = new Buffer(512)
var LOG_TABLE = new Buffer(256)

if(Buffer.alloc) {
var EXP_TABLE = Buffer.alloc(512)
var LOG_TABLE = Buffer.alloc(256)
} else {
var EXP_TABLE = new Buffer(512)
var LOG_TABLE = new Buffer(256)
}
/**
* Precompute the log and anti-log tables for faster computation later
*
Expand Down
Loading

0 comments on commit a40c757

Please sign in to comment.