save serial data to variable?

I'd probably use "memcpy" and the data from the "indices" array to work out the start and length, then terminate the temporary array afterwards.