mirror of
https://dev.iopsys.eu/bbf/icwmp.git
synced 2026-03-05 08:50:42 +01:00
SPV and SPA should return fault when param name is empty
This commit is contained in:
parent
b3db549d24
commit
8c715595eb
1 changed files with 27 additions and 0 deletions
27
xml.c
27
xml.c
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue