function makeMessage(msgType, length) {

    const total_length = length + 4 + 1;

    total_length.should.be.greaterThan(0);

    const buf = Buffer.alloc(total_length);

    buf.writeUInt8(msgType.charCodeAt(0), 0);
    buf.writeUInt32LE(total_length, 1);

    for (let i = 0; i < length; i++) {
        buf.writeUInt8(msgType.charCodeAt(0), i + 5);
    }

    return buf;
}
The software does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources.