A fully open source & end-to-end encrypted note taking alternative to Evernote.
TypeScript asp-net-coredotnet-coreelectronfosshacktoberfestnote-managmentnote-takingnote-taking-appnotebooknotesnotes-appopen-sourceopensourceprivacyproductivityreactreact-nativereactjsself-hosted
fs: fix out of bounds error when reading chunks
Abdullah Atta568c88be3eb0
diff --git a/packages/streamable-fs/src/filehandle.ts b/packages/streamable-fs/src/filehandle.tsindex ec2f8bd95..04f66c8bd 100644--- a/packages/streamable-fs/src/filehandle.ts+++ b/packages/streamable-fs/src/filehandle.ts@@ -71,7 +71,7 @@ export default class FileHandle {async readChunks(from: number, length: number): Promise<Blob> {const blobParts: BlobPart[] = [];- for (let i = from; i < from + length; ++i) {+ for (let i = from; i < Math.min(from + length, this.file.chunks); ++i) {const array = await this.readChunk(i);if (!array) continue;blobParts.push(array.buffer);