bufferlist: avoid reading past the array