Printing a null byte in server console cuts off the entire string

1. FXServer version: 4273 windows
2. What happens: Printing a null byte in the server console cuts of the entire string. It probably isn’t that big of a problem on itself, but it seems that undefined in node is just a null byte, thus console logging an undefined variable inside node runtime will print absolutely nothing.
3. Category of bug (eg. client, server, weapons, peds, native): Server
4. Reproducible steps, preferably with example script(s):
nullbyte.zip (590 Bytes)

console.log('hello before', 1)
console.log(undefined, 2)
console.log('Hello after', 3)
console.log('\0 test', 3)

image

1 Like

Conjecture. I’d somewhat doubt that, these are rather two different unrelated things.

Yeah, I have no clue what else it could be. This seemed to be the only logical reasoning as in svgui it even broke the script context label or whatever it’s called
image

Yeah two different things indeed. Weird shit.

image
image

The undefined case is fairly simple:

    function format(message = undefined, ...args) {
        if (typeof message === "undefined") {
            return '';
        }

The spec mentioned doesn’t really mention undefined as a special case, this should really just pass into formatValue and then pass further args down.

(and the null terminator one is likely a case of propagation of strings without explicit length)

Both issues should be fixed now.

2 Likes