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

Commit b5438aa6 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "net: ping: check if length is non-zero before copy"

parents 0acf3633 6ed92325
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -611,8 +611,11 @@ int ping_getfrag(void *from, char *to,
	if (offset == 0) {
		if (fraglen < sizeof(struct icmphdr))
			BUG();
		if (csum_partial_copy_fromiovecend(to + sizeof(struct icmphdr),
			    pfh->iov, 0, fraglen - sizeof(struct icmphdr),
		if ((fraglen - sizeof(struct icmphdr)) &&
		    csum_partial_copy_fromiovecend
					(to + sizeof(struct icmphdr),
					pfh->iov, 0,
					fraglen - sizeof(struct icmphdr),
					&pfh->wcheck))
			return -EFAULT;
	} else if (offset < sizeof(struct icmphdr)) {