Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b726e73c authored by Skylar Chang's avatar Skylar Chang Committed by Gerrit - the friendly Code Review server
Browse files

msm: ipa: prevent string buffer overflows



On rmnet_ipa_set_data_quota() API, add the
string terminator to prevent vulnerability
of string buffer overflows on debug prints.

Change-Id: Ie669f6606f76b9006bce4edd0c6d04aef9cfb600
Signed-off-by: default avatarSkylar Chang <chiaweic@codeaurora.org>
parent 560a996d
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -2618,6 +2618,9 @@ static int rmnet_ipa_set_data_quota_modem(struct wan_ioctl_set_data_quota *data)
	if (!data->set_quota)
		ipa_qmi_stop_data_qouta();

	/* prevent string buffer overflows */
	data->interface_name[IFNAMSIZ-1] = '\0';

	index = find_vchannel_name_index(data->interface_name);
	IPAWANERR("iface name %s, quota %lu\n",
			  data->interface_name,
+3 −0
Original line number Diff line number Diff line
@@ -2745,6 +2745,9 @@ static int rmnet_ipa3_set_data_quota_modem(
	if (!data->set_quota)
		ipa3_qmi_stop_data_qouta();

	/* prevent string buffer overflows */
	data->interface_name[IFNAMSIZ-1] = '\0';

	index = find_vchannel_name_index(data->interface_name);
	IPAWANERR("iface name %s, quota %lu\n",
		  data->interface_name,