From nobody Sat May 4 17:16:11 2024 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=1623773196; cv=none; d=zohomail.com; s=zohoarc; b=cQS2dyouJkWvM3hIoOZFkV7jSsk1jySv445EJ2Tk3qZv3DhtYlV+VJKOtQ2yiOLx9MjZeZIZRq8x3xiZfwDusdkpToUca0W93ad5EdPAgxNob2iH1El3LvPN+5I/NBwgBKzlieNe8gQj10uMf9f65kRG4YAH1rwSgwrbTdUr8+E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1623773196; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=yj3/SD9ZkIZB4WSm2wMUUZaftxv1SUW0zvzFOQL0Lzw=; b=m+qlwHG3jo9R1WTn1HCcjpvye9L/EyqL6ACnPJkFR3ri90jciOTujys1Ixx3Scz6V0IR2MwR7ruksxGWZ9Dv/JbpQ+qKG1yzQRjrfMCBPKSx7bY82tLsasvNnxB15q7edqpDPj7IzWPBdjmXp6qnjQw1If7LfYMMliTz1sV1jvM= 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 1623773196249954.2603964476893; Tue, 15 Jun 2021 09:06:36 -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-404-ugkaEy4SOOu4n7HFZS2mrg-1; Tue, 15 Jun 2021 12:06:33 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 669F8192FDA0; Tue, 15 Jun 2021 16:05:56 +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 45F5660FC2; Tue, 15 Jun 2021 16:05:56 +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 DF09346F59; Tue, 15 Jun 2021 16:05:55 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 15FG5tOf020512 for ; Tue, 15 Jun 2021 12:05:55 -0400 Received: by smtp.corp.redhat.com (Postfix) id 39ECF1037E80; Tue, 15 Jun 2021 16:05:55 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.193.174]) by smtp.corp.redhat.com (Postfix) with ESMTP id B13281002F12 for ; Tue, 15 Jun 2021 16:05:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623773195; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=yj3/SD9ZkIZB4WSm2wMUUZaftxv1SUW0zvzFOQL0Lzw=; b=eX2ooMumiDGv633lj07KYsbT6D1fwl9gDFpcJTeljGHPHNbJiGRw5M9ot/pg41kgbLBagK Zg/W8S0LIPVEuM5eqRzMZZro+TmNqvhPANiEhx1AkEc0v8CMUqVHLGkueQxfKhH0zUeb73 g3U662Yjm3o0A//HfMRE/YH2qJUTctw= X-MC-Unique: ugkaEy4SOOu4n7HFZS2mrg-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH] virFindFileInPath: Don't pass NULL to g_canonicalize_filename() Date: Tue, 15 Jun 2021 18:05:49 +0200 Message-Id: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 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.12 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" If given file is not found in $PATH then g_find_program_in_path() returns NULL. However, g_canonicalize_filename() does not accept NULL as input. Fixes: 65c2901906b5e2d707f9184ff3719a5375bab427 Signed-off-by: Michal Privoznik Reviewed-by: Peter Krempa --- src/util/virfile.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/util/virfile.c b/src/util/virfile.c index c302202573..4f98b011be 100644 --- a/src/util/virfile.c +++ b/src/util/virfile.c @@ -1667,6 +1667,8 @@ virFindFileInPath(const char *file) return NULL; =20 path =3D g_find_program_in_path(file); + if (!path) + return NULL; =20 /* Workaround for a bug in g_find_program_in_path() not returning abso= lute * path as documented. This has been fixed in --=20 2.31.1