If the value you are passing into your function for the parameter
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
strncpy(mode->param3, param3, 255);
This will guard against this situation.