From b612eed9068d1eed505888a45d694cbce1f7ee90 Mon Sep 17 00:00:00 2001 From: Michael Zillgith Date: Mon, 23 May 2016 09:51:06 +0200 Subject: [PATCH] - fixed seg fault bug (introduced in 0.9.1) in unbuffered reporting --- src/iec61850/server/mms_mapping/reporting.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/iec61850/server/mms_mapping/reporting.c b/src/iec61850/server/mms_mapping/reporting.c index dce3e80d..a94d59da 100644 --- a/src/iec61850/server/mms_mapping/reporting.c +++ b/src/iec61850/server/mms_mapping/reporting.c @@ -31,10 +31,10 @@ #include "simple_allocator.h" #include "mem_alloc_linked_list.h" -#include "reporting.h" #include "mms_mapping_internal.h" #include "mms_value_internal.h" #include "conversions.h" +#include "reporting.h" #include #ifndef DEBUG_IED_SERVER @@ -602,7 +602,8 @@ updateReportDataset(MmsMapping* mapping, ReportControl* rc, MmsValue* newDatSet, success = true; - rc->isBuffering = true; + if (rc->buffered) + rc->isBuffering = true; goto exit_function; } @@ -770,7 +771,7 @@ createUnbufferedReportControlBlock(ReportControlBlock* reportControlBlock, rcb->typeSpec.structure.elementCount = structSize; - rcb->typeSpec.structure.elements = (MmsVariableSpecification**) GLOBAL_CALLOC(12, + rcb->typeSpec.structure.elements = (MmsVariableSpecification**) GLOBAL_CALLOC(structSize, sizeof(MmsVariableSpecification*)); MmsVariableSpecification* namedVariable =