mirror of
https://github.com/nodemailer/wildduck.git
synced 2025-10-17 01:06:35 +08:00
fixed exception with invalid buffer length
This commit is contained in:
parent
64ccb33ee5
commit
df1b73083a
1 changed files with 4 additions and 2 deletions
|
@ -63,8 +63,10 @@ class LengthLimiter extends Transform {
|
||||||
_flush(done) {
|
_flush(done) {
|
||||||
if (!this.finished) {
|
if (!this.finished) {
|
||||||
// add padding if incoming stream stopped too early
|
// add padding if incoming stream stopped too early
|
||||||
|
if (this.expectedLength > this.byteCounter) {
|
||||||
let buf = Buffer.from(this.padding.repeat(this.expectedLength - this.byteCounter));
|
let buf = Buffer.from(this.padding.repeat(this.expectedLength - this.byteCounter));
|
||||||
this.push(buf);
|
this.push(buf);
|
||||||
|
}
|
||||||
this.finished = true;
|
this.finished = true;
|
||||||
}
|
}
|
||||||
done();
|
done();
|
||||||
|
|
Loading…
Add table
Reference in a new issue