For my mysql.mod, I want to be able to accept binary data. Users should be able to pass binary data to mysql_escape. However, it's passed to the module as a pointer. So, I effectively can't tell where the binary data argument ends (strlen() only reads to the first null, which is not the end of the argument).
Anyone know how I can determine the length of the data being passed to the function?
The only real method is to pass a second argument with the length of the data.
This pretty much goes along the lines of putdccraw. You can pass and use embeded NULLs in the data. For it to function correctly, the length is passed.