- fixed bug in server side delete-data-set service. Server crashes when client sends an unknown LD/domain name

pull/6/head
Michael Zillgith 11 years ago
parent 1700bca56b
commit 4cc0b4fe13

@ -80,6 +80,9 @@ MmsDomain_getNamedVariableList(MmsDomain* self, char* variableListName)
{ {
MmsNamedVariableList variableList = NULL; MmsNamedVariableList variableList = NULL;
if (self == NULL)
goto exit_function;
LinkedList element = LinkedList_getNext(self->namedVariableLists); LinkedList element = LinkedList_getNext(self->namedVariableLists);
while (element != NULL) { while (element != NULL) {
@ -93,6 +96,8 @@ MmsDomain_getNamedVariableList(MmsDomain* self, char* variableListName)
element = LinkedList_getNext(element); element = LinkedList_getNext(element);
} }
exit_function:
return variableList; return variableList;
} }

@ -141,6 +141,8 @@ mmsServer_handleDeleteNamedVariableListRequest(MmsServerConnection connection,
MmsDomain* domain = MmsDevice_getDomain(device, domainName); MmsDomain* domain = MmsDevice_getDomain(device, domainName);
if (domain != NULL) {
MmsNamedVariableList variableList = MmsDomain_getNamedVariableList(domain, listName); MmsNamedVariableList variableList = MmsDomain_getNamedVariableList(domain, listName);
if (variableList != NULL) { if (variableList != NULL) {
@ -153,6 +155,7 @@ mmsServer_handleDeleteNamedVariableListRequest(MmsServerConnection connection,
numberDeleted++; numberDeleted++;
} }
} }
}
} }
} }
else if (request->listOfVariableListName->list.array[i]->present == ObjectName_PR_aaspecific) { else if (request->listOfVariableListName->list.array[i]->present == ObjectName_PR_aaspecific) {

Loading…
Cancel
Save