Fix a possible buffer overlapping in the driver