Executing this script leads to buf being uninitialized.
let buf = Buffer.alloc(0x100, "This is not correctly encoded", "hex");
console.log(buf);
 

I highly suspect this is because Buffer.alloc() calls buffer.fill() after allocating memory, which doesn't fill the buffer when it cannot decode the value parameter.