Yes, the coding style is quite bad here.
The buffers are separately allocated and cannot overlap.