If the value you are passing into your function for the parameter
char* param3
is a string that is longer than 255 characters or it is not null terminated then this could be your problem.
I would suggest replacing the line
strcpy(mode->param3, param3);
with
strncpy(mode->param3, param3, 255);
mode->param3[254]='\0'
This will guard against this situation.