From nobody Mon Feb 9 06:02:15 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.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=1675180986; cv=none; d=zohomail.com; s=zohoarc; b=Xmu4qMVXGq91pIpLeu5wZYPaN3p0WptQ+pdGZEETWQkHNqd81+9IjKHGsVEDQZh5sV3eLFtSwvSS+kUmbfl9UDHriuSIGw0qcDf5dXtavrKo30hQxWO1cV3th+mgU551Wi7KO456Sfni6iIcMSgHq1wcI8mHwKNSr5NLir7hVwY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675180986; 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=Pz7py1yRnd9M8sizrsvQDuDDajPDVvJAW8jePX9SEuU=; b=MfZbrT4ViywnxJJxI5RUGrXsKt6LTBQZ57s5rSBUFj38Rmklg69A5dBFT5HdCgQeTg3hBYhVGFx+iB6czAn3Cvg2HD/bKzjabCcCR/1xJCFwHExacvPiOHmNpX1lZ6xaicD7+WetpbRVk6h4gI4EwY0adbrdSd/2PXirVYoFyfk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.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.129.124]) by mx.zohomail.com with SMTPS id 1675180986782313.44051212578313; Tue, 31 Jan 2023 08:03:06 -0800 (PST) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-651-urbyYY3QM_CKGJ7wxO1Law-1; Tue, 31 Jan 2023 11:02:42 -0500 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9B4E02807D89; Tue, 31 Jan 2023 16:02:32 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7DEA6492B0D; Tue, 31 Jan 2023 16:02:32 +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 F0D961946A41; Tue, 31 Jan 2023 16:02:31 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 0CD731946587 for ; Tue, 31 Jan 2023 16:02:31 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id D61544010E36; Tue, 31 Jan 2023 16:02:30 +0000 (UTC) Received: from speedmetal.lan (ovpn-208-29.brq.redhat.com [10.40.208.29]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4300C401531C for ; Tue, 31 Jan 2023 16:02:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675180985; 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=Pz7py1yRnd9M8sizrsvQDuDDajPDVvJAW8jePX9SEuU=; b=azFcdDtJ1sr8WeW9SxElXP1zNdmq9mReFEEJZ8ERwBsPIBugXaLwgG9FJ5bJLZ14H+EUvY HcoCKxdP2Od3/6H+YIThgNl/oZjdAVh/VC9VoPeKWM3WI8l11H3TwsLuOvZo2AhuK/u9c/ s3AEeYUuU2rxQhwTfMngWdd30HnRcl0= X-MC-Unique: urbyYY3QM_CKGJ7wxO1Law-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 3/7] virStorageBackendISCSISetAuth: Use g_strndup to '\0' terminate data Date: Tue, 31 Jan 2023 17:02:15 +0100 Message-Id: <7af95e8b02d5d12d7e407cfaaf84a06f568c4e79.1675180728.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 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.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1675180987175100003 Content-Type: text/plain; charset="utf-8" Signed-off-by: Peter Krempa --- src/storage/storage_backend_iscsi.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/storage/storage_backend_iscsi.c b/src/storage/storage_back= end_iscsi.c index e4fa49d05f..01900f6809 100644 --- a/src/storage/storage_backend_iscsi.c +++ b/src/storage/storage_backend_iscsi.c @@ -283,10 +283,8 @@ virStorageBackendISCSISetAuth(const char *portal, &secret_value, &secret_size) < 0) return -1; - secret_str =3D g_new0(char, secret_size + 1); - memcpy(secret_str, secret_value, secret_size); + secret_str =3D g_strndup((char *) secret_value, secret_size); virSecureErase(secret_value, secret_size); - secret_str[secret_size] =3D '\0'; if (virISCSINodeUpdate(portal, source->devices[0].path, --=20 2.39.1