From nobody Fri Apr 26 10:14:30 2024 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1555329833; cv=none; d=zoho.com; s=zohoarc; b=lHLDwzYQw0n01DiKVMnQB3FTZGDlBopFWK9qzdq51TTw01gYg8ry9tpYkxi/lKIymRdZa/WjaL5nmVlxUhqbWnLQugPzAAlW0DMlWejUXkKOorMDNsyiarEBfehWOdxrtvc3azIvw/8hLbyIQyaDAbVT3yocsleSYnB7LBcBW+I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1555329833; h=Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=5LpgpJaVSubI+2jQfiZaFyAcPNlSXkwPd9Ojr3jPtNk=; b=B+yee4XLFiKU3ZRsj23RDuO7n2N/hRiSWJsknP+TrvVGwwxlzhyJYuhC0tx/8dPyPCBqj4nzBiMxBVu02zOa80PSI1IaDJCy0bQF5q5BN7+auYjjVX1+tjYxJOV7GACc+j1a9UCCqt9W9R3qu5XCb4nlC/kb8ukGIGSXLlEfq88= ARC-Authentication-Results: i=1; mx.zoho.com; spf=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 155532983389678.1524154229246; Mon, 15 Apr 2019 05:03:53 -0700 (PDT) Received: from localhost ([127.0.0.1]:49281 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hG0Ko-0004Rz-D8 for importer@patchew.org; Mon, 15 Apr 2019 08:03:38 -0400 Received: from eggs.gnu.org ([209.51.188.92]:55045) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hG0JV-0003z7-LE for qemu-devel@nongnu.org; Mon, 15 Apr 2019 08:02:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hG0JU-00036E-MI for qemu-devel@nongnu.org; Mon, 15 Apr 2019 08:02:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59402) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hG0JU-00035h-H9 for qemu-devel@nongnu.org; Mon, 15 Apr 2019 08:02:16 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9B10A308222E; Mon, 15 Apr 2019 12:02:09 +0000 (UTC) Received: from dgilbert-t580.localhost (ovpn-117-222.ams2.redhat.com [10.36.117.222]) by smtp.corp.redhat.com (Postfix) with ESMTP id C38F360F9B; Mon, 15 Apr 2019 12:02:07 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, samuel.thibault@gnu.org, jan.kiszka@siemens.com Date: Mon, 15 Apr 2019 13:02:05 +0100 Message-Id: <20190415120205.2221-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Mon, 15 Apr 2019 12:02:10 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v2] slirp: Gcc 9 -O3 fix X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: "Dr. David Alan Gilbert" Gcc 9 needs some convincing that sopreprbuf really is going to fill in iov in the call from soreadbuf, even though the failure case shouldn't happen. Signed-off-by: Dr. David Alan Gilbert --- slirp/src/socket.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/slirp/src/socket.c b/slirp/src/socket.c index 4a3c935e25..beb8517f1c 100644 --- a/slirp/src/socket.c +++ b/slirp/src/socket.c @@ -181,7 +181,7 @@ soread(struct socket *so) * No need to check if there's enough room to read. * soread wouldn't have been called if there weren't */ - sopreprbuf(so, iov, &n); + assert(sopreprbuf(so, iov, &n) !=3D 0); =20 nn =3D recv(so->s, iov[0].iov_base, iov[0].iov_len,0); if (nn <=3D 0) { @@ -257,6 +257,7 @@ int soreadbuf(struct socket *so, const char *buf, int s= ize) * No need to check if there's enough room to read. * soread wouldn't have been called if there weren't */ + assert(size > 0); if (sopreprbuf(so, iov, &n) < size) goto err; =20 --=20 2.21.0