Return to strrpos_offset.phpt CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / standard / tests / strings |
1.1 misho 1: --TEST-- 2: strrpos() offset integer overflow 3: --FILE-- 4: <?php 5: 6: var_dump(strrpos("t", "t", PHP_INT_MAX+1)); 7: var_dump(strrpos("tttt", "tt", PHP_INT_MAX+1)); 8: var_dump(strrpos(100, 101, PHP_INT_MAX+1)); 9: var_dump(strrpos(1024, 1024, PHP_INT_MAX+1)); 10: var_dump(strrpos(1024, 1024, -PHP_INT_MAX)); 11: var_dump(strrpos(1024, "te", -PHP_INT_MAX)); 12: var_dump(strrpos(1024, 1024, -PHP_INT_MAX-1)); 13: var_dump(strrpos(1024, "te", -PHP_INT_MAX-1)); 14: 15: echo "Done\n"; 16: ?> 17: --EXPECTF-- 18: Warning: strrpos(): Offset is greater than the length of haystack string in %s on line %d 19: bool(false) 20: 21: Warning: strrpos(): Offset is greater than the length of haystack string in %s on line %d 22: bool(false) 23: 24: Warning: strrpos(): Offset is greater than the length of haystack string in %s on line %d 25: bool(false) 26: 27: Warning: strrpos(): Offset is greater than the length of haystack string in %s on line %d 28: bool(false) 29: 30: Warning: strrpos(): Offset is greater than the length of haystack string in %s on line %d 31: bool(false) 32: 33: Warning: strrpos(): Offset is greater than the length of haystack string in %s on line %d 34: bool(false) 35: 36: Warning: strrpos(): Offset is greater than the length of haystack string in %s on line %d 37: bool(false) 38: 39: Warning: strrpos(): Offset is greater than the length of haystack string in %s on line %d 40: bool(false) 41: Done