recGbl: Prevent record alarm severities > INVALID_ALARM
This commit is contained in:
@@ -16,6 +16,15 @@ Base-3.15 series or to EPICS 7.</p>
|
||||
|
||||
<!-- Insert new items immediately below here ... -->
|
||||
|
||||
<h3>Prevent illegal alarm severities</h3>
|
||||
|
||||
<p>A check has been added to <tt>recGblResetAlarms()</tt> that prevents records
|
||||
from getting an alarm severity higher than INVALID_ALARM. It is still possible
|
||||
for a field like HSV to get set to a value that is not a legal alarm severity,
|
||||
but the core IOC code should never copy such a value into a record's SEVR or
|
||||
ACKS fields. With this fix the record's alarm severity will be limited to
|
||||
INVALID_ALARM.</p>
|
||||
|
||||
<h3>Fixes for Launchpad bugs</h3>
|
||||
|
||||
<p>The following launchpad bugs have fixes included:</p>
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include <limits.h>
|
||||
|
||||
#include "dbDefs.h"
|
||||
#include "alarm.h"
|
||||
#include "epicsMath.h"
|
||||
#include "epicsTime.h"
|
||||
#include "epicsPrint.h"
|
||||
@@ -222,6 +223,9 @@ unsigned short epicsShareAPI recGblResetAlarms(void *precord)
|
||||
epicsEnum16 val_mask = 0;
|
||||
epicsEnum16 stat_mask = 0;
|
||||
|
||||
if (new_sevr > INVALID_ALARM)
|
||||
new_sevr = INVALID_ALARM;
|
||||
|
||||
pdbc->stat = new_stat;
|
||||
pdbc->sevr = new_sevr;
|
||||
pdbc->nsta = 0;
|
||||
|
||||
Reference in New Issue
Block a user