diff --git a/dmtree/tr181/deviceinfo.c b/dmtree/tr181/deviceinfo.c index 0d47f244..04303940 100644 --- a/dmtree/tr181/deviceinfo.c +++ b/dmtree/tr181/deviceinfo.c @@ -1308,9 +1308,14 @@ static int operate_DeviceInfoFirmwareImage_Download(char *refparam, struct dmctx char *url = dmjson_get_value((json_object *)value, 1, "URL"); char *auto_activate = dmjson_get_value((json_object *)value, 1, "AutoActivate"); - if (url[0] == '\0' || auto_activate[0] == '\0') + if (url[0] == '\0') return CMD_INVALID_ARGUMENTS; + // Assuming auto activate as false, if not provided by controller, in case of strict validation, + // this should result into a fault + if (DM_STRLEN(auto_activate) == 0) + auto_activate="0"; + char *username = dmjson_get_value((json_object *)value, 1, "Username"); char *password = dmjson_get_value((json_object *)value, 1, "Password"); char *file_size = dmjson_get_value((json_object *)value, 1, "FileSize");