resize buffer size if packet length is greater