From 0621d9ce9b262781a4336dca8b5599bdcca66057 Mon Sep 17 00:00:00 2001 From: Michael Zillgith Date: Tue, 1 Dec 2020 12:09:49 +0100 Subject: [PATCH] - Client: fixed - IedConnection_getRCBValues doesn't check type of server response (#283) --- src/iec61850/client/client_report_control.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/iec61850/client/client_report_control.c b/src/iec61850/client/client_report_control.c index 390863e4..085e4a75 100644 --- a/src/iec61850/client/client_report_control.c +++ b/src/iec61850/client/client_report_control.c @@ -698,11 +698,22 @@ IedConnection_getRCBValues(IedConnection self, IedClientError* error, const char if (returnRcb == NULL) returnRcb = ClientReportControlBlock_create(rcbReference); - clientReportControlBlock_updateValues(returnRcb, rcb); + if (clientReportControlBlock_updateValues(returnRcb, rcb)) { + *error = IED_ERROR_OK; + } + else { + if (DEBUG_IED_CLIENT) + printf("DEBUG_IED_CLIENT: getRCBValues returned wrong type!\n"); - MmsValue_delete(rcb); + *error = IED_ERROR_TYPE_INCONSISTENT; - *error = IED_ERROR_OK; + if (updateRcb == NULL) { + ClientReportControlBlock_destroy(returnRcb); + returnRcb = NULL; + } + } + + MmsValue_delete(rcb); return returnRcb; }