From nobody Thu May 2 01:15:52 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=virtuozzo.com ARC-Seal: i=1; a=rsa-sha256; t=1586787554; cv=none; d=zohomail.com; s=zohoarc; b=BfeaGHGSibC3/jALmyEspyUvE9c706BucBykoX+ld71bFrIp6B03vtqclPQAYkPBOClcRCCoZD/FAo/+aqIAnwLcDfhg1RimnA0diEqbxbnztJWVdW9jGn03lCMZ/vgO89DEDIvHbf7C6LRGkux5U8EWkXOUjjEV7BlC8+uPPec= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1586787554; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:Sender:Subject:To; bh=XlznrI0SVzfAsK2lzOFl3XagzSPAc3CTgQ3hDAd6Aw0=; b=QSwIy0nkFBXvynC+p/hjVG9PRXGoEkMcGrdozGuZ0WbjhG+amq06IE2bXavriT+wk9difHKw8RzwaX+EDp6ErtDlsuKpRr7wwJ+t3IYCJsfq1fwGfnUBy8zoj6ehZnClUfkxGFh6SphRolxtbhqSmBjkUnPvWwUpF4cb/zf5j34= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1586787554620616.4095349737072; Mon, 13 Apr 2020 07:19:14 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-112-jdc9FHCdOhGIAN8rDGDiNA-1; Mon, 13 Apr 2020 10:19:11 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2FCB6800D53; Mon, 13 Apr 2020 14:19:03 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0ED8C5D9E2; Mon, 13 Apr 2020 14:19:02 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 72CA793068; Mon, 13 Apr 2020 14:18:58 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 03DEIuCZ008511 for ; Mon, 13 Apr 2020 10:18:57 -0400 Received: by smtp.corp.redhat.com (Postfix) id 92B8FB5505; Mon, 13 Apr 2020 14:18:56 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast02.extmail.prod.ext.rdu2.redhat.com [10.11.55.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8EB83C1246 for ; Mon, 13 Apr 2020 14:18:53 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B14858007D0 for ; Mon, 13 Apr 2020 14:18:53 +0000 (UTC) Received: from relay.sw.ru (relay.sw.ru [185.231.240.75]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-140-oB_GLV8KOz-vnTNz2SgMwQ-1; Mon, 13 Apr 2020 10:18:51 -0400 Received: from [172.16.50.114] (helo=vz7.localdomain) by relay.sw.ru with esmtp (Exim 4.92.3) (envelope-from ) id 1jNzvD-00049a-QB for libvir-list@redhat.com; Mon, 13 Apr 2020 17:18:47 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1586787553; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=XlznrI0SVzfAsK2lzOFl3XagzSPAc3CTgQ3hDAd6Aw0=; b=HKaPAIjXPLujJ+a/ThNOUWgLKQZfUXjyBPmeO8kZIb9BEX0yRp9Di8iBI7auxGg6VLbyib gmQRl38cdjxkehImDSDsLQDAyhYnLts30Bo1Ofn3+ZGFwfy9zBYIGPn2CrdYPe5Vx7ZsDZ p9hJilt2s2A0FEdSdqfwbdjq8oUGLMA= X-MC-Unique: jdc9FHCdOhGIAN8rDGDiNA-1 X-MC-Unique: oB_GLV8KOz-vnTNz2SgMwQ-1 From: Nikolay Shirokovskiy To: libvir-list@redhat.com Subject: [PATCH] util: fix iteration in virSocketAddrResolveService Date: Mon, 13 Apr 2020 17:18:31 +0300 Message-Id: <1586787511-767454-1-git-send-email-nshirokovskiy@virtuozzo.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 03DEIuCZ008511 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 2 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" getaddrinfo returns linked list. Fix iteration accordingly. Signed-off-by: Nikolay Shirokovskiy Reviewed-by: Daniel Henrique Barboza --- src/util/virsocketaddr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/virsocketaddr.c b/src/util/virsocketaddr.c index 4cad329..4c9f124 100644 --- a/src/util/virsocketaddr.c +++ b/src/util/virsocketaddr.c @@ -271,7 +271,7 @@ int virSocketAddrResolveService(const char *service) port =3D ntohs(in.sin6_port); goto cleanup; } - tmp++; + tmp =3D tmp->ai_next; } =20 virReportError(VIR_ERR_SYSTEM_ERROR, --=20 1.8.3.1