SPV and SPA should return fault when param name is empty

This commit is contained in:
Mohamed Kallel 2013-09-26 09:43:07 +01:00 committed by Strhuan Blomquist
parent b3db549d24
commit 8c715595eb

27
xml.c
View file

@ -1112,6 +1112,12 @@ int cwmp_handle_rpc_cpe_set_parameter_values(struct session *session, struct rpc
parameter_value = NULL;
}
if (b && b->type == MXML_ELEMENT &&
!strcmp(b->value.element.name, "Name") &&
!b->child) {
parameter_name = "";
}
if (b && b->type == MXML_TEXT &&
b->value.text.string &&
b->parent->type == MXML_ELEMENT &&
@ -1119,6 +1125,12 @@ int cwmp_handle_rpc_cpe_set_parameter_values(struct session *session, struct rpc
parameter_value = b->value.text.string;
}
if (b && b->type == MXML_ELEMENT &&
!strcmp(b->value.element.name, "Value") &&
!b->child) {
parameter_value = "";
}
if (parameter_name && parameter_value) {
if (external_set_action("value", parameter_name, parameter_value, NULL))
goto fault;
@ -1226,18 +1238,33 @@ int cwmp_handle_rpc_cpe_set_parameter_attributes(struct session *session, struct
!strcmp(b->parent->value.element.name, "Name")) {
parameter_name = b->value.text.string;
}
if (b && b->type == MXML_ELEMENT &&
!strcmp(b->value.element.name, "Name") &&
!b->child) {
parameter_name = "";
}
if (b && b->type == MXML_TEXT &&
b->value.text.string &&
b->parent->type == MXML_ELEMENT &&
!strcmp(b->parent->value.element.name, "NotificationChange")) {
attr_notification_update = b->value.text.string;
}
if (b && b->type == MXML_ELEMENT &&
!strcmp(b->value.element.name, "NotificationChange") &&
!b->child) {
attr_notification_update = "";
}
if (b && b->type == MXML_TEXT &&
b->value.text.string &&
b->parent->type == MXML_ELEMENT &&
!strcmp(b->parent->value.element.name, "Notification")) {
parameter_notification = b->value.text.string;
}
if (b && b->type == MXML_ELEMENT &&
!strcmp(b->value.element.name, "Notification") &&
!b->child) {
parameter_notification = "";
}
if (attr_notification_update && parameter_name && parameter_notification) {
if (external_set_action("notification", parameter_name,
parameter_notification, attr_notification_update))