add limit to String#split
protect against buffer length too small and too large