Skip to content

Commit

Permalink
ecmcMotorRecordCreateAxis: Add sanity check of axisNo.
Browse files Browse the repository at this point in the history
  • Loading branch information
anderssandstrom committed Feb 11, 2020
1 parent 0363133 commit bcda8f7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions devEcmcSup/motor/ecmcMotorRecordAxis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,11 @@ extern "C" int ecmcMotorRecordCreateAxis(const char *controllerPortName,
int axisFlags,
const char *axisOptionsStr)
{
if( (axisNo >= ECMC_MAX_AXES) || (axisNo < 0)) {
printf("ERROR: axisNo out of range. Allowed values 0..%d\n", ECMC_MAX_AXES - 1);
return asynError;
}

if (!controllerPortName || (axisNo < 0) || (axisFlags < 0)) {
printf("\n");
printf("Iocsh command to create a model 3 asyn motor record driver axis for use with ECMC.\n");
Expand Down

0 comments on commit bcda8f7

Please sign in to comment.