|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2016-03-18 00:13 UTC] hanskrentel at yahoo dot de
Description:
------------
I managed to make file_get_contents() return NULL which is undocumented (string and FALSE is documented).
Technically the case ("\0" as filename) triggers a warning so might not construe an error, but actually smells a lot like an error finally and should be FALSE.
This would also reduce handling return value logic.
So far it's merely unnoticed as undocumented, no idea if it's a technical difficulty to fix or just an oversight.
As this is NUL byte related this might make underlying problems visible.
As I'm undecided, I filed it as bug. It could be a documentation problem or security issue. Also a change request. As it could be all three, I filed it as bug which is undefined as well. HTH
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 07 07:00:01 2026 UTC |
File path cannot contain NUL char. /* Parse arguments */ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|br!ll", &filename, &filename_len, &use_include_path, &zcontext, &offset, &maxlen) == FAILURE) { return; } "p" is used and "\0" results in invalid path and zend_parse_parameters() fails. That's the reason why it returns NULL. All other functions that expects file path returns NULL for "\0" due to zend_parse_parameters() failure.