Fix possible buffer overrun

these arrays may be accessed at (1..512) below

    for (int i=0; i < 512 && i < numParameters; i++)
	{
		dataArray[i+1]=data[i];
		lengthsArray[i+1]=lengths[i];
	}