Can we split this function to make sure we don't use this trick? So have the actual real scan func be called on the original scanbuf or a new allocated data.