check that buf is populated