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

Commit 7cf413c7 authored by Mohammed Javid's avatar Mohammed Javid Committed by Gerrit - the friendly Code Review server
Browse files

msm: ipa: Fix to add string NULL terminator



Missing null terminator to userspcae provided
string leads to strlen buffer overflow in strlcpy function.
Added code changes to fix string NULL terminator issue.

Change-Id: I3f9d5f22fbb26f68de12370bc5e07a4e6bc2ced9
Acked-by: default avatarAshok Vuyyuru <avuyyuru@qti.qualcomm.com>
Signed-off-by: default avatarMohammed Javid <mjavid@codeaurora.org>
parent b7d21b00
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -1608,6 +1608,7 @@ static int ipa_wwan_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
				IPAWANERR("Failed to allocate memory.\n");
				IPAWANERR("Failed to allocate memory.\n");
				return -ENOMEM;
				return -ENOMEM;
			}
			}
			extend_ioctl_data.u.if_name[IFNAMSIZ-1] = '\0';
			len = sizeof(wan_msg->upstream_ifname) >
			len = sizeof(wan_msg->upstream_ifname) >
			sizeof(extend_ioctl_data.u.if_name) ?
			sizeof(extend_ioctl_data.u.if_name) ?
				sizeof(extend_ioctl_data.u.if_name) :
				sizeof(extend_ioctl_data.u.if_name) :
+1 −0
Original line number Original line Diff line number Diff line
@@ -1699,6 +1699,7 @@ static int ipa3_wwan_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
				IPAWANERR("Failed to allocate memory.\n");
				IPAWANERR("Failed to allocate memory.\n");
				return -ENOMEM;
				return -ENOMEM;
			}
			}
			extend_ioctl_data.u.if_name[IFNAMSIZ-1] = '\0';
			len = sizeof(wan_msg->upstream_ifname) >
			len = sizeof(wan_msg->upstream_ifname) >
			sizeof(extend_ioctl_data.u.if_name) ?
			sizeof(extend_ioctl_data.u.if_name) ?
				sizeof(extend_ioctl_data.u.if_name) :
				sizeof(extend_ioctl_data.u.if_name) :