Fix segmentation fault 'denial of service condition'