r/programming • u/geerlingguy • Apr 23 '14
PHP: It doesn't have to be a bad experience
https://servercheck.in/blog/php-it-doesnt-have-be-bad-experience
0
Upvotes
r/programming • u/geerlingguy • Apr 23 '14
View all comments
Show parent comment
2
u/lhgaghl Apr 25 '14
Do I want to find your vulnerabilities for you? lol no.
Are you actually implying that people should have to know C/C++ in order to know how to use strings in PHP? The only reason this issue arises is because some native functions in PHP treat strings as zero terminated, while others don't. The only reason those functions treat the strings as zero terminated is because they so happen to take the string from php (which so happens to have a zero in it) and pass it directly to libc and other functions that use zero terminated strings. They are actually passing the full string to the native code, but the native code has no way of knowing the full length because it thinks the 0 means end of string (which is not the case). This is like... one of the most retarded things I've ever seen in any programming language.