file_get_contents misinterpreting the result...
}
/* uses mmap if possible */
- if ((len = php_stream_copy_to_mem(stream, &contents, PHP_STREAM_COPY_ALL, 0)) > 0) {
+ if ((len = php_stream_copy_to_mem(stream, &contents, PHP_STREAM_COPY_ALL, 0)) >= 0) {
if (PG(magic_quotes_runtime)) {
contents = php_addslashes(contents, len, &newlen, 1 TSRMLS_CC); /* 1 = free source string */
#endif
srcfile = mmap(NULL, maxlen, PROT_READ, MAP_SHARED, srcfd, 0);
- if (srcfile != (void*)MAP_FAILED && ret > 0) {
+ if (srcfile != (void*)MAP_FAILED) {
*buf = pemalloc_rel_orig(maxlen + 1, persistent);