1
0
Эх сурвалжийг харах

fix: 9p: limit read size to replybuffer size (fix Linux 5.15)

Fabian 2 жил өмнө
parent
commit
4fa37f354f
1 өөрчлөгдсөн 2 нэмэгдсэн , 0 устгасан
  1. 2 0
      lib/9p.js

+ 2 - 0
lib/9p.js

@@ -593,6 +593,8 @@ Virtio9p.prototype.ReceiveRequest = async function (bufchain) {
                 this.fs.OpenInode(this.fids[fid].inodeid, undefined);
                 const inodeid = this.fids[fid].inodeid;
 
+                count = Math.min(count, this.replybuffer.length - (7 + 4));
+
                 if (inode.size < offset+count) count = inode.size - offset;
                 else if(id == 40)
                 {