Forum: Cfengine Help
Subject: Re: splitstring and nullbytes
Author: joke
Link to topic: https://cfengine.com/forum/read.php?3,18907,18915#msg-18915

After a little bit of testing I think this is a bug.

The input processing seems to have problems with null-bytes. Either the output 
of execresult isn't copied to the assigned variable or processing this 
variables later on doesn't respect null-bytes.
I think this problem might be related to using strcpy rather then memcpy while 
coping the result during processing.

In any case the reference manual should clearly mention that string variables 
are c-strings not strings.

For example my shell does proper string handling. Both statements produce the 
same output:

files="$(find -print0)"; echo "$files" | cat -A
find -print0 | cat -A


_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to