The issue arises when Node.js is used with UCS-2 encoding, which is recognized under the names `ucs2`, `ucs-2`, `utf16le`, and `utf-16le`. In this context, the `Buffer#write()` function can be exploited to write beyond the boundaries of a single buffer. Specifically, writes that initiate from the second-to-last position of a buffer lead to a miscalculation of the maximum length of the input bytes to be written.