code: func validLogEntriesLen(p []byte) (n int) {
  	r := bytes.NewReader(p)
  	for {
  		if sz, err := binary.ReadUvarint(r); err != nil {
  			return n
  		} else if off, err := r.Seek(int64(sz), io.SeekCurrent); err != nil {
  			return n
  		} else if off > int64(len(p)) {
  			return n
  		} else {
  			n = int(off)
  		}
  	}
  }
docs: // validLogEntriesLen returns the maximum length of p that contains valid entries.