From 0d999027c28f6fe63bddc7460cbcec6cce3d5906 Mon Sep 17 00:00:00 2001 From: Ron Sluiter Date: Fri, 20 Dec 2013 16:41:07 +0000 Subject: [PATCH] Protect against NULL *parms pointer motor record. --- motorApp/MicosSrc/devMicos.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/motorApp/MicosSrc/devMicos.cc b/motorApp/MicosSrc/devMicos.cc index 81e898f3..d57f70ef 100644 --- a/motorApp/MicosSrc/devMicos.cc +++ b/motorApp/MicosSrc/devMicos.cc @@ -157,7 +157,8 @@ static RTN_STATUS Micos_build_trans(motor_cmnd command, double *parms, struct mo rtnval = OK; buff[0] = '\0'; - dval = parms[0]; + /* Protect against NULL pointer with WRTITE_MSG(GO/STOP_AXIS/GET_INFO, NULL). */ + dval = (parms == NULL) ? 0.0 : *parms; ival = NINT(parms[0]); rtnval = (RTN_STATUS) motor_start_trans_com(mr, Micos_cards);