From nobody Mon Feb 9 09:01:30 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1617285424; cv=none; d=zohomail.com; s=zohoarc; b=bjlhj0CVqzHoVLFS5TqeWS+zJye3/p9v/liYcZqd9YST44UfcKK0iojQBnS6XUAZoKZ9WebGMiN/RugIOqLn5YePr2aNB5nygzV4ng03AXVo7yRLMK5w6pxlGiPgjKtkPFdv2WkVBwmxwAG3odWm1UGC6MIiIXMe4LL3m1Z5L0Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1617285424; 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=twsGclirYIQSM6/IJ2wYEItPD2XB2+iyenSygHrEi04=; b=gyucmZ4cCXVcBJ16dQwQxXYmV3pIn8xhs9B6TpEm0x2LEaEj8iuubd9OoRZ8IUinoOs4m//Y6UjAJksN7p86/OEmyy2t0NfR0HnypxsPf5dp8NwYSX3IjPFFEa3nQGwaTVXTDN3WA0bTHuchfl1sesE39YiywlkF+nrCKHjPw/k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 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-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1617285424752245.61029841797256; Thu, 1 Apr 2021 06:57:04 -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-199-nTE0QsAeMfCmL0oTdhwD1w-1; Thu, 01 Apr 2021 09:55:33 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C6F7B1085985; Thu, 1 Apr 2021 13:55:19 +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 95D1019D7D; Thu, 1 Apr 2021 13:55:19 +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 272024A704; Thu, 1 Apr 2021 13:55:19 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 131DsMf8023677 for ; Thu, 1 Apr 2021 09:54:22 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8D6605C237; Thu, 1 Apr 2021 13:54:22 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.33]) by smtp.corp.redhat.com (Postfix) with ESMTP id F15695C1A1 for ; Thu, 1 Apr 2021 13:54:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617285423; 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=twsGclirYIQSM6/IJ2wYEItPD2XB2+iyenSygHrEi04=; b=G5iZBmapFg6VTuFaSAXf0H02hDlNNnt0rfq5/WK5hbtB+aiQXFXkRF+iSZ9sNKEJJpgpDx wrEj3yvPnYYqU0jd6La4N+2l8gdSEROeRAEcUhMVGSHDewcJqoj3CQfSD9n3DaLqj2LKrZ I8QsuT9lWL4yxJzUuNlI6jcbFwBp6Xo= X-MC-Unique: nTE0QsAeMfCmL0oTdhwD1w-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 36/39] virSystemdActivationInitFromNames: Replace virStringSplit by g_strsplit Date: Thu, 1 Apr 2021 15:52:35 +0200 Message-Id: <59dad78008c9c6b9420d6cbe61e2a3be0c61d110.1617285119.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" While the code invokes the string list length calculation twice, it happens only on error path, which by itself should never happen. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/util/virsystemd.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/util/virsystemd.c b/src/util/virsystemd.c index cf22edaa0a..718d24dfc5 100644 --- a/src/util/virsystemd.c +++ b/src/util/virsystemd.c @@ -754,19 +754,18 @@ virSystemdActivationInitFromNames(virSystemdActivatio= nPtr act, { g_auto(GStrv) fdnamelistptr =3D NULL; char **fdnamelist; - size_t nfdnames; size_t i; int nextfd =3D STDERR_FILENO + 1; VIR_DEBUG("FD names %s", fdnames); - if (!(fdnamelistptr =3D virStringSplitCount(fdnames, ":", 0, &nfdnames= ))) + if (!(fdnamelistptr =3D g_strsplit(fdnames, ":", 0))) goto error; - if (nfdnames !=3D nfds) { + if (g_strv_length(fdnamelistptr) !=3D nfds) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Expecting %d FD names but got %zu"), - nfds, nfdnames); + _("Expecting %d FD names but got %u"), + nfds, g_strv_length(fdnamelistptr)); goto error; } --=20 2.29.2