From nobody Fri Mar 24 05:00:14 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PjVQ64kwTz4144P; Fri, 24 Mar 2023 05:00:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PjVQ643lGz42j1; Fri, 24 Mar 2023 05:00:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679634014; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fu54WWaeEs6n8IOANTkRJZTmDjHaQrQ8U8IBLolNV1E=; b=uLM+2CNMX+nmRLqvTS36gwf0a5S/+LCVR4nBP1IfosagJNlepl62GZZnrQrxyw2AVt2S/9 MB0lwqewilNeMVRxOt3/YurTNDTcNwbXQU59Yyy2fR6OEY75wOcbgC+zRpfo02eFg+TP7n eqRwxOKXKzEn1TWkwLr/8akaxM7CaSR4hXgHQxGSkuMK+5gq4TXUzzLROSip2cYTgy3TnF T0hRC/d8ripRjMkTzVvfnPJFACwyoQdinh1vUCFinpF+mTN5T+iNUPAkx4bvQW5eTPEpVb Xx4EHJ9/yiqd4iEpo5ZH9F1VsBpljP9aXMSBcKufX6hKXW0a9If0zKxPmO8EXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679634014; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fu54WWaeEs6n8IOANTkRJZTmDjHaQrQ8U8IBLolNV1E=; b=pUnVxCUlzVA96CAEtfl0wgBjjS9FRC9ySFaIzPUQsqnpexyL4AohP4Wt3B7CyAXQecYlpo U1vDCvee3+Sgu3yBojObDIfJUaKmZXqA1EKwnYnovXnKXRL7YchJWyRWP+2kMURGssXXsy QF/Azj6iBYlJ6fsiI1LjXHQyX71cHWQpBIAr0CKiZyg4rusabF9NnMxqqrsDvyOHQwWoIS iF8Rk72tGXWwdTSzwsgDqB0Q+dcsrQYGS6FWdPYF1phmqA0Hy0u1vq6OtoJqdrMtBSX7hW 7ZQS/DlxP/CvlOxJKOKhSLd0Sj1Q9WbKdCESK303+uOaRy0lYXnHyHQZLrRU2w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679634014; a=rsa-sha256; cv=none; b=lM244mYyCyHos330izc+Ept76GZyXDAfYRsubZm1Cm1XE8Px0TiDppNdA0IVTnBBu3VHph 75GejsBtzbuQ7i4esA+eLxopfYXzkNkdHjJt50cSIhYEfWteVkMXuvYoaI2o4Q3giNppI/ m3S6T+96RF1pmp7qEzh/CqTi8Qg2fLslP0W5igCfM4Ky/TWRV3+vHOKSbZdVWctmymORDH tIIG4ui4runRRpUrC1FAmfIHrww6Q8/SfDA1JN4rBCpICetmpX3ks5/JRgqOYFZ/7TtfeP CzOeLVD+C2kRA8SpDGa38TP7HBXPv7DE6EIdd/HwnXHN4OhK/ptJKi2dSJPCUA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PjVQ637l9z14cW; Fri, 24 Mar 2023 05:00:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32O50EDS016640; Fri, 24 Mar 2023 05:00:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32O50Evk016633; Fri, 24 Mar 2023 05:00:14 GMT (envelope-from git) Date: Fri, 24 Mar 2023 05:00:14 GMT Message-Id: <202303240500.32O50Evk016633@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: 4630a3252ac8 - main - ping: Fix an uninitialized variable List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4630a3252ac8ad2f5acddf0d1efb26795cb3190b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=4630a3252ac8ad2f5acddf0d1efb26795cb3190b commit 4630a3252ac8ad2f5acddf0d1efb26795cb3190b Author: Jose Luis Duran AuthorDate: 2023-03-24 04:53:54 +0000 Commit: Cy Schubert CommitDate: 2023-03-24 04:58:28 +0000 ping: Fix an uninitialized variable The variable oicmp, which holds the original ("quoted packet") ICMP packet in a structured way, did not have a copy of the original ICMP packet obtained from the raw data. The code was accidentally removed in 20b41303140e. Bring it back. Reported by: Coverity Scan, cy Reviewed by: cy CID: 1506960 (UNINIT) Fixes: 20b41303140eee4dfb896558fb83600c5f013d39 MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D39233 --- sbin/ping/ping.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sbin/ping/ping.c b/sbin/ping/ping.c index 6b82fe3da9de..965b565da7b9 100644 --- a/sbin/ping/ping.c +++ b/sbin/ping/ping.c @@ -1156,6 +1156,7 @@ pr_pack(char *buf, ssize_t cc, struct sockaddr_in *from, struct timespec *tv) struct ip oip; u_char oip_header_len; struct icmp oicmp; + const u_char *oicmp_raw; /* * Get size of IP header of the received packet. @@ -1359,6 +1360,8 @@ pr_pack(char *buf, ssize_t cc, struct sockaddr_in *from, struct timespec *tv) } memcpy(&oip, icmp_data_raw, sizeof(struct ip)); + oicmp_raw = icmp_data_raw + oip_header_len; + memcpy(&oicmp, oicmp_raw, sizeof(struct icmp)); if (((options & F_VERBOSE) && uid == 0) || (!(options & F_QUIET2) &&