Skip to content
Snippets Groups Projects
Commit 691c7ca9 authored by Jakob Olsson's avatar Jakob Olsson
Browse files

libmobile_zte: use str_remove_substr to sanitize query

parent bbcfc26d
Branches
No related tags found
No related merge requests found
......@@ -518,11 +518,19 @@ fail:
struct json_object *mobile_create_apn_profile_zte(char *ip_addr, struct profile_params_zte *params)
{
char query[1024] = {0};
char query[1024] = {0}, *sanitized_query;
struct json_object *response;
snprintf(query, 1023, "isTest=false&goformId=APN_PROC_EX&apn_action=save&apn_mode=manual&profile_name=%s&wan_dial=*99%%23&apn_select=manual&pdp_type=%s&pdp_select=auto&pdp_addr=&index=%d&wan_apn=%s&ppp_auth_mode=%s&ppp_username=%s&ppp_passwd=%s&dns_mode=%s&prefer_dns_manual=%s&standby_dns_manual=%s", params->name, params->pdp_type, get_apn_profiles_len(ip_addr), params->wan_apn, params->authentication, params->username, params->password, params->dns_mode, params->dns1, params->dns2);
sanitized_query = str_remove_substr(query, "(null)");
if (!sanitized_query)
goto fail;
return perform_request(ip_addr, query, POST);
response = perform_request(ip_addr, sanitized_query, POST);
free(sanitized_query);
fail:
return response;
}
struct json_object *mobile_set_apn_profile_zte(char *ip_addr, char *name)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment