id_sequence[3] = 456;
Since the array is only allocated to hold three elements, the valid indices are 0 to 2; so, the assignment to id_sequence[3] is out of bounds.
In the following code, it is possible to request that memcpy move a much larger segment of memory than assumed:
(bad code)