From b00f152456df1bba87defefd2335d59defa8cf32 Mon Sep 17 00:00:00 2001 From: Marty Kraimer Date: Wed, 9 Apr 1997 19:35:56 +0000 Subject: [PATCH] makesure GPIBFASTO has val in range --- src/dev/devCommonGpib.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/dev/devCommonGpib.c b/src/dev/devCommonGpib.c index cf97e14ed..0af8587c5 100644 --- a/src/dev/devCommonGpib.c +++ b/src/dev/devCommonGpib.c @@ -3,6 +3,9 @@ /* * $Log$ + * Revision 1.31 1997/04/09 18:33:49 mrk + * Restore original + * * Revision 1.29 1996/06/12 20:04:51 winans * Added better debugging code to the initXX logic. * @@ -97,6 +100,7 @@ #include #include +#include #include #include #include @@ -2245,11 +2249,22 @@ unsigned short val; /* used for EFAST operations only */ status = (*(parmBlock->wrConversion))(status, pdpvt); } break; - case GPIBCNTL: /* send cmd with atn line active */ + case GPIBCNTL: /* send cmd with atn line active */ status = (*(drvGpib.writeIbCmd))(pdpvt->head.pibLink, pCmd->cmd, strlen(pCmd->cmd)); break; - case GPIBEFASTO: /* write the enumerated cmd from the P3 array */ + case GPIBEFASTO: /* write the enumerated cmd from the P3 array */ + if(pCmd->P3==NULL) { + epicsPrintf("%s devSup : GPIBEFASTO specified but no EFAST Table\n"); + return(ERROR); + } else { + int i; + /*Check that val in bounds*/ + if(val>15) return(ERROR); + for(i=0; i<=val; i++ ) { + if(P3[i]==NULL) return(ERROR); + } + } if (pCmd->P3[val] != NULL) { status = (*(drvGpib.writeIb))(pdpvt->head.pibLink,ibnode, pCmd->P3[val],