From 08661b5daf6149a134df92ed8f0ed6720e2ac6a4 Mon Sep 17 00:00:00 2001 From: Alexander Mueller <alexander.mueller@hs.uni-hamburg.de> Date: Fri, 14 Oct 2005 15:10:33 +0000 Subject: [PATCH] BugID: 447 Two faults in the source code of the GCFCommon are the reason of the segmentation fault in the KeyValueLoggerMaster. As expected the seg. fault occours at unpacking of the GCFPVDynArr. This is solved now. --- MAC/GCF/GCFCommon/src/GCF_PVDynArr.cc | 2 +- MAC/GCF/GCFCommon/src/GCF_PValue.cc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/MAC/GCF/GCFCommon/src/GCF_PVDynArr.cc b/MAC/GCF/GCFCommon/src/GCF_PVDynArr.cc index 967723ffe15..940a408b671 100644 --- a/MAC/GCF/GCFCommon/src/GCF_PVDynArr.cc +++ b/MAC/GCF/GCFCommon/src/GCF_PVDynArr.cc @@ -69,7 +69,7 @@ unsigned int GCFPVDynArr::unpackConcrete(const char* valBuf) for (unsigned int i = 0; i < arraySize; i++) { - pNewValue = GCFPValue::createMACTypeObject((TMACValueType) (getType() | LPT_DYNARR)); + pNewValue = GCFPValue::createMACTypeObject((TMACValueType) (getType() & ~LPT_DYNARR)); pNewValue->setDataFormat(_dataFormat); diff --git a/MAC/GCF/GCFCommon/src/GCF_PValue.cc b/MAC/GCF/GCFCommon/src/GCF_PValue.cc index eca2d089c71..863da22a7c7 100644 --- a/MAC/GCF/GCFCommon/src/GCF_PValue.cc +++ b/MAC/GCF/GCFCommon/src/GCF_PValue.cc @@ -96,7 +96,7 @@ GCFPValue* GCFPValue::createMACTypeObject(TMACValueType type) GCFPValue* GCFPValue::unpackValue(const char* valBuf) { - GCFPValue* pValue = createMACTypeObject((TMACValueType) *valBuf); + GCFPValue* pValue = createMACTypeObject((TMACValueType) (uchar) *valBuf); if (pValue) { unsigned int readLength = pValue->unpack(valBuf); @@ -111,7 +111,7 @@ GCFPValue* GCFPValue::unpackValue(const char* valBuf) unsigned int GCFPValue::unpack(const char* valBuf) { - ASSERT(_type == (TMACValueType) *valBuf); + ASSERT(_type == (TMACValueType) (uchar) *valBuf); _dataFormat = (LOFAR::DataFormat) valBuf[1]; // the type was already set, because it was set on construction of this class // later maybe also a timestamp can be assigned to a value. -- GitLab