Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/core/FuzzedDataProvider.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -946,6 +946,11 @@ describe("FuzzedDataProvider checks", () => {
expect(strings).toContain("m dol");
expect(strings).toContain("or si");
expect(strings).toContain("t ame");
const moreStrings = data.consumeStringArray(5, 0);
expect(moreStrings).toHaveLength(5);
for (const str of moreStrings) {
expect(str).toHaveLength(0);
}
});
it("verifyPrintableString", () => {
const data = new FuzzedDataProvider(Buffer.from(Data));
Expand Down
2 changes: 1 addition & 1 deletion packages/core/FuzzedDataProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ export class FuzzedDataProvider {
const strs = [];
while (strs.length < maxArrayLength && this.remainingBytes > 0) {
const str = this.consumeString(maxStringLength, encoding, printable);
if (str) {
if (str || str === "") {
strs.push(str);
}
}
Expand Down