Annotation of embedaddon/php/ext/standard/tests/file/bug39673.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #39673 (file_get_contents causes bus error on certain offsets)
! 3: --FILE--
! 4: <?php
! 5:
! 6: $str = str_repeat("test", 3456);
! 7:
! 8: $filename = dirname(__FILE__).'/bug39673.txt';
! 9: file_put_contents($filename, $str);
! 10:
! 11: $offsets = array(
! 12: -1,
! 13: 0,
! 14: 3456*4,
! 15: 3456*4 - 1,
! 16: 3456*4 + 1,
! 17: 2000,
! 18: 5000,
! 19: 100000,
! 20: );
! 21:
! 22:
! 23: foreach ($offsets as $offset) {
! 24: $r = file_get_contents($filename, false, null, $offset);
! 25: var_dump(strlen($r));
! 26: }
! 27:
! 28: @unlink($filename);
! 29: echo "Done\n";
! 30: ?>
! 31: --EXPECTF--
! 32: int(13824)
! 33: int(13824)
! 34: int(0)
! 35: int(1)
! 36: int(0)
! 37: int(11824)
! 38: int(8824)
! 39: int(0)
! 40: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>