From nobody Sun Feb 8 22:48:51 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1670841141; cv=none; d=zohomail.com; s=zohoarc; b=NO1dtYcQiKJ5Yg3VKsxoU4otmaDvYKxEIE5Ee0s+nz2R0EPH+RjHLfpkLQ6X+d92Vhl2iC3yHUNgPnHDCuTTDz7zzTpvlEBRLoyeBkj4UG66h9+i/k+wiLVIBfMPz6b5pknRBRt7MvYp8QtdwWLN733PrGLmXeGWawCiFX8oSs8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1670841141; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=GS66hlNPUe4XIfEv391+lwEZ+OwUPAUGeT00ghy4O9Y=; b=UDKoXNpm7q3vqBePZOMZ4gbGm0076hMmzKlIV0pFmRtEGxBwA7yv3272nxC7Nyq1cD/03xwleEd/xffnH7w7kppMotX5yYocYGUZcGOsPW3AoDzptC5LtJr4Esw4/3WUh2aS/9VjC7+EzinkVW855eQ+VyOjM8R5G0rIuEzwFNQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1670841141513871.4534911249419; Mon, 12 Dec 2022 02:32:21 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-524-Q_i_yn2PPJmOvRzu0_T3Sw-1; Mon, 12 Dec 2022 05:32:16 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A6DDC101AA79; Mon, 12 Dec 2022 10:32:13 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8EA3A4010D2A; Mon, 12 Dec 2022 10:32:13 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 2C69C1946A50; Mon, 12 Dec 2022 10:32:11 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 95F911946586 for ; Mon, 12 Dec 2022 10:32:09 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 8667E17595; Mon, 12 Dec 2022 10:32:09 +0000 (UTC) Received: from virtlab420.virt.lab.eng.bos.redhat.com (virtlab420.virt.lab.eng.bos.redhat.com [10.19.152.148]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6B7D251EF; Mon, 12 Dec 2022 10:32:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1670841140; h=from:from:sender:sender: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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=GS66hlNPUe4XIfEv391+lwEZ+OwUPAUGeT00ghy4O9Y=; b=Pa2q06oU1iiHDa0uhLrp4kEmR6Ou/8rTeEdJEultYptVDY8xbaaPWkVnl4l4m9q9EVG6n/ Di3wJawjgRzCLpKvshjBCWMHsH9mi+r9PVbiLDMmPkgUMbDGtNExmpss0EtlUrQYsHZXt5 acpeRWxCBHXbQ9g5FKrQ+lJTMWbG6KA= X-MC-Unique: Q_i_yn2PPJmOvRzu0_T3Sw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH 2/3] rpc: fix buffer offset updates after decoding payload Date: Mon, 12 Dec 2022 05:32:07 -0500 Message-Id: <20221212103208.531717-3-berrange@redhat.com> In-Reply-To: <20221212103208.531717-1-berrange@redhat.com> References: <20221212103208.531717-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1670841141957100001 The buffer length refers to the allocated buffer memory size, while the offset refers to have much of the buffer we have read/written. After reading the message payload we must thus update the latter. Signed-off-by: Daniel P. Berrang=C3=A9 --- src/rpc/virnetmessage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rpc/virnetmessage.c b/src/rpc/virnetmessage.c index ceba1a5a8e..438c75b049 100644 --- a/src/rpc/virnetmessage.c +++ b/src/rpc/virnetmessage.c @@ -423,7 +423,7 @@ int virNetMessageDecodePayload(virNetMessage *msg, } =20 /* Get the length stored in buffer. */ - msg->bufferLength +=3D xdr_getpos(&xdr); + msg->bufferOffset +=3D xdr_getpos(&xdr); xdr_destroy(&xdr); return 0; =20 --=20 2.38.1