check range on int to ptr cast

2 jobs for master in 18 minutes and 22 seconds (queued for 5 seconds)