Skip to content
This repository was archived by the owner on Apr 30, 2021. It is now read-only.

Commit c05103a

Browse files
author
Yevgeny Pats
committed
Update INTERESTING32
1 parent 93ce761 commit c05103a

File tree

4 files changed

+6
-10
lines changed

4 files changed

+6
-10
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ This will save the html report to `coverage` directory
119119

120120
## Other languages
121121

122-
Currently this library is also ported to python via [pythonfuzz](https://github.com/fuzzitdev/jsfuzz)
122+
Currently this library is also ported to python via [pythonfuzz](https://github.com/fuzzitdev/pythonfuzz)
123123

124124
## Credits & Acknowledgments
125125

examples/xml/fuzz.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const xml2js = require('xml2js')
1+
const xml2js = require('xml2js');
22

33
async function fuzz (bytes) {
44
const string = String.fromCodePoint(...bytes)

src/corpus.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,11 @@ var crypto = require('crypto');
55

66
const INTERESTING8 = new Uint8Array([-128, -1, 0, 1, 16, 32, 64, 100, 127]);
77
const INTERESTING16 = new Uint16Array([-32768, -129, 128, 255, 256, 512, 1000, 1024, 4096, 32767, -128, -1, 0, 1, 16, 32, 64, 100, 127]);
8-
const INTERESTING32 = new Uint32Array([-2147483648, -100663046, -32769, 32768, 65535, 65536, 100663045, 2147483647, -32768, -129, 128, 255, 256, 512, 1000, 1024, 4096, 32767]);
8+
const INTERESTING32 = new Uint32Array([-2147483648, -100663046, -32769, 32768, 65535, 65536, 100663045, 2147483647, -32768, -129, 128, 255, 256, 512, 1000, 1024, 4096, 32767, -128, -1, 0, 1, 16, 32, 64, 100, 127]);
99

1010

1111
export class Corpus {
1212
private inputs: Buffer[];
13-
private seedPath: string | undefined;
1413
private corpusPath: string | undefined;
1514
private maxInputSize: number;
1615
private seedLength: number;
@@ -295,7 +294,7 @@ export class Corpus {
295294
i--;
296295
continue;
297296
}
298-
const other = this.inputs[this.rand(this.inputs.length)]
297+
const other = this.inputs[this.rand(this.inputs.length)];
299298
if (other.length < 4) {
300299
i--;
301300
continue;
@@ -331,7 +330,7 @@ export class Corpus {
331330
const pos0 = this.rand(res.length+1);
332331
const pos1 = this.rand(other.length-2);
333332
const n = this.chooseLen(other.length-pos1-2) + 2;
334-
res = Buffer.concat([res, Buffer.alloc(n, 0)], res.length + n)
333+
res = Buffer.concat([res, Buffer.alloc(n, 0)], res.length + n);
335334
res.copy(res, pos0+n, pos0);
336335
for (let k=0; k<n; k++) {
337336
res[pos0+k] = other[pos1+k]

src/fuzzer.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ export class Fuzzer {
119119
return;
120120
} else if (m.coverage > this.total_coverage) {
121121
this.total_coverage = m.coverage;
122-
this.logStats('NEW');
123122
this.corpus.putBuffer(buf);
123+
this.logStats('NEW');
124124
if (buf.length > 0 && this.versifier) {
125125
this.verse = BuildVerse(this.verse, buf);
126126
}
@@ -162,9 +162,6 @@ export class Fuzzer {
162162
});
163163

164164
this.pulseInterval = setInterval(() => {
165-
// @ts-ignore
166-
const diff = Date.now() - this.startTime;
167-
const execs_per_sec = Math.trunc(executions/diff*1000);
168165
this.logStats("PULSE");
169166
}, 3000);
170167

0 commit comments

Comments
 (0)