In PHP, the term "binary-safe" sounds to me like a security feature to help defend against binary exploitation such as a buffer overflow, etc.
I'm also aware that some functions have "multi-byte aware" alternatives that are prefixed with mb_
. For example, substr
and mb_substr
. These functions are able to handle characters that consume more than one byte.
However, what are the implications of passing binary data into a function that is not binary safe? Is this an inherent security risk, or will the function just return a warning/error?
I am not talking about the output of the function that may be passed into SQL, HTML, etc, I'm talking about the actual processing of the function within PHP itself.
Are non-binary-safe functions only designed to securely handle text, and there is a risk of a buffer overflow or other form of binary exploitation when passing binary data into them?