From nobody Sun Feb 8 19:55:20 2026 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1598559638; cv=none; d=zohomail.com; s=zohoarc; b=Tp4bMycdmtCC3otEhqDxr4+xd+dp1LCviQPPLgl4CHwOfN368c9+0qg+miKtkCzKb6BQM7cvPYfM6gBa/GPwkI4jQ7AXbf1qDESgEa6L4s7Y8Xp8yipAQ4AfAWRCsU70x8+6YeiYCMDzsOOrwMV8wtkkDKkuKhhHWAbFgjHiw44= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598559638; 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=eXzcfFT7MbNrYFd2+F2oT/gRrCGObCMR6zrTDrR33sI=; b=F9/oP3MWuOvJ2mAd1GWVERo0NNHZtKs6/nHVVF62py9qjI857ChBViOFhO5fjiaWXuFu1Dds5vJeaUrdl5czXz5t6zWbIPPFx3lUwXg2ZuMYS7QXsaTgHI/q7gtmKrTPBxrK2o8KtiXE4b/Z5FrEl8PXGEe+aLWTOBXOXPy9ATA= 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=pass 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 1598559638124875.9864435788942; Thu, 27 Aug 2020 13:20:38 -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-306-dyyjNqdtOgm_Y6xXBvEEuQ-1; Thu, 27 Aug 2020 16:20:33 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 46ED856BE4; Thu, 27 Aug 2020 20:20:28 +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 25BD360DA7; Thu, 27 Aug 2020 20:20:28 +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 EB9B09A054; Thu, 27 Aug 2020 20:20:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 07RKK8GU029120 for ; Thu, 27 Aug 2020 16:20:08 -0400 Received: by smtp.corp.redhat.com (Postfix) id B1E6419D7C; Thu, 27 Aug 2020 20:20:08 +0000 (UTC) Received: from lpt.redhat.com (unknown [10.40.208.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2F35219C71 for ; Thu, 27 Aug 2020 20:20:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1598559636; 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=eXzcfFT7MbNrYFd2+F2oT/gRrCGObCMR6zrTDrR33sI=; b=efD8bRSw24LeInpf1XTdap/w2T6gjuGvdVq7R+zJvikPZBf7vDxkZ7ReUJa/qRIv3DV5eR MRBloG/Qhb6JMqOTLjD1vR6SQ47zS52ztQnjEHxDQbNfwaVmAs815eqkfwfQ5QYXE1x7Bn CnhgqrTg/0nhQSDpjPHW5aDRS0/oKNM= X-MC-Unique: dyyjNqdtOgm_Y6xXBvEEuQ-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 07/11] esx: esxConnectOpen: use allocated buffer Date: Thu, 27 Aug 2020 22:19:49 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Signed-off-by: J=C3=A1n Tomko --- src/esx/esx_driver.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c index 3fb7a3b62c..9158a2bc89 100644 --- a/src/esx/esx_driver.c +++ b/src/esx/esx_driver.c @@ -813,7 +813,7 @@ esxConnectOpen(virConnectPtr conn, virConnectAuthPtr au= th, virDrvOpenStatus result =3D VIR_DRV_OPEN_ERROR; esxPrivate *priv =3D NULL; char *potentialVCenterIPAddress =3D NULL; - char vCenterIPAddress[NI_MAXHOST] =3D ""; + g_autofree char *vCenterIPAddress =3D g_new0(char, NI_MAXHOST); =20 virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR); =20 @@ -876,8 +876,9 @@ esxConnectOpen(virConnectPtr conn, virConnectAuthPtr au= th, goto cleanup; } =20 - if (virStrcpyStatic(vCenterIPAddress, - potentialVCenterIPAddress) < 0) { + if (virStrcpy(vCenterIPAddress, + potentialVCenterIPAddress, + NI_MAXHOST) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, _("vCenter IP address %s too big for de= stination"), potentialVCenterIPAddress); --=20 2.26.2