[base] Buffer: type-cast fix