From patchwork Thu Mar 14 15:11:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dodji Seketeli X-Patchwork-Id: 87196 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 143F13857C7C for ; Thu, 14 Mar 2024 15:12:01 +0000 (GMT) X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id D3A8E3858C31 for ; Thu, 14 Mar 2024 15:11:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D3A8E3858C31 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D3A8E3858C31 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1710429117; cv=none; b=BTTMnKjFEMk1+7pKCC7vna+P653Z/EBoHuaQLvaocdSKbxqMZgMmQu42byBUBk6HsRS4tUItnQNHCB9MyCOHUnrRAPLCqjyZxsoMqiFkA6OSeS+rat45uPab8/0XTF8RgNp6an3Y0CzoQ9MSfwDeFXayRJxQ9jcEGNgOOj4fzIE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1710429117; c=relaxed/simple; bh=5PIPuvLU6AdsUsNN9KYc0en2qCmPUOtQdZFF8SkFd9A=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=HpOQ71sIj1kHsCAauSz8oEegRzt+YuSZPCxkbp2WPYDHWcFYDySw5kFQo9otlTw/rNeyIytSTLZqfkleb2GfEK0MMxj6MO2XaUh+MHlC/d69dDI0RJl89Mg3FpSPqKZLQfQOr+OPsoLbqhJKK0EDq2DV+itfHoow4hZqGv/RL+M= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1710429114; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=XVPQJatbakHCv3N8gFZM6nPy9Nblfho39+CngT1dUzI=; b=Ge1Sd1nEHl2AeUCnq6AKGdoNEWN+oqH6oYPxU68UkMrk1jCXh7X0v6ZZwQKGVGoPV67iLr N0UcCY9kL5BP/J8IdS/mewnrVZbVl/rJllvfM6T+2c2/8uB429R/5w/R5N3tYxbKgc1r9k 3NfTFYuyQnlIEEMloSoyZ8rTUhBlBXw= Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-687-XZLp2QK5MiizKothm4J5wA-1; Thu, 14 Mar 2024 11:11:48 -0400 X-MC-Unique: XZLp2QK5MiizKothm4J5wA-1 Received: by mail-qt1-f198.google.com with SMTP id d75a77b69052e-42eeee47028so8067031cf.3 for ; Thu, 14 Mar 2024 08:11:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710429108; x=1711033908; h=mime-version:user-agent:message-id:date:organization:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=XVPQJatbakHCv3N8gFZM6nPy9Nblfho39+CngT1dUzI=; b=qaz7QHjt/QY6rQnGDu5m4U5pguIV37HtCx54XOmdgsKd+Q0v6SrKW0gPHMgZH2uuKZ rUSSUJdwBj1cJm/cGXyiLflw/qGIuycQr/3YF3qd796/70jt43848ohoST9XcOjimggX xMV+JbseicHEcNM06Zh9J/9p4PYuj0iELnVTob90zmWycUgKR2r3kNu0T6tt8CfaCOrJ RccSI7Edy6y9FNZp2QEH7eK2i8N0UYwsWLomlW0nqQBA3vNt7ai3ZtWFD5P4wOQxKNog zLQdGpCRIveUr6Sty+n6BMh1924vdlZG7pTAOLr9qsF9lIrHJxe5nzy9mmGjNMAjik+1 cLJQ== X-Gm-Message-State: AOJu0YwjL4aMpjsAmTvZUgm38V5jMqvsD2xGKkj1x/qJn/nL/D9S07BA oH5eCccUEqAroBhwbdh/MwH57WQfpJ7xmmkyE5YmIe/9vOv2FGIEu4Mw7HH4992AbuZj/zWVWXQ MPqevP6j/dZ1rUc/tVc1AdZ7QCz2evQSadVp6OC6UMHUfGEWadIPPdqSbFnrLaHE8C3MbobBMwl PSObekgfG19MvmLqntyK3RwLNfOBq0aLjQJFbJDQ== X-Received: by 2002:ac8:5fc6:0:b0:42e:da42:9c73 with SMTP id k6-20020ac85fc6000000b0042eda429c73mr1061875qta.57.1710429107648; Thu, 14 Mar 2024 08:11:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH4EvlBkKImKK3UHpVRGByeEab1Bdbs0JDGi2su0vyvYthTLbUnwRlgWk0YP2u1rdkAfxgwfA== X-Received: by 2002:ac8:5fc6:0:b0:42e:da42:9c73 with SMTP id k6-20020ac85fc6000000b0042eda429c73mr1061844qta.57.1710429107188; Thu, 14 Mar 2024 08:11:47 -0700 (PDT) Received: from localhost (88-120-130-27.subs.proxad.net. [88.120.130.27]) by smtp.gmail.com with ESMTPSA id o23-20020ac872d7000000b00430a67b3437sm327554qtp.17.2024.03.14.08.11.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Mar 2024 08:11:46 -0700 (PDT) Received: by localhost (Postfix, from userid 1000) id 208BEC1B75F0; Thu, 14 Mar 2024 16:11:44 +0100 (CET) From: Dodji Seketeli To: libabigail@sourceware.org Subject: [PATCH, applied to mainline] tools-utils.cc: Fix potential crash when testing for CTF debug info Organization: Red Hat / France X-Operating-System: AlmaLinux 9.3 X-URL: http://www.redhat.com Date: Thu, 14 Mar 2024 16:11:44 +0100 Message-ID: <87a5n0sv9r.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, RCVD_IN_SORBS_WEB, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Mailing list of the Libabigail project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libabigail-bounces+patchwork=sourceware.org@sourceware.org Hello, When looking at something else, I stumbled upon a crash when testing for the presence of CTF debug info. * src/abg-tools-utils.cc (file_has_ctf_debug_info): Do not crash on empty debug info paths. Signed-off-by: Dodji Seketeli Applied to mainline. --- src/abg-tools-utils.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/abg-tools-utils.cc b/src/abg-tools-utils.cc index 08d50347..2115113b 100644 --- a/src/abg-tools-utils.cc +++ b/src/abg-tools-utils.cc @@ -516,7 +516,7 @@ file_has_ctf_debug_info(const string& elf_file_path, // vmlinux.ctfa could be provided with --debug-info-dir for (const auto& path : debug_info_root_paths) - if (find_file_under_dir(*path, "vmlinux.ctfa", vmlinux)) + if (path && *path && find_file_under_dir(*path, "vmlinux.ctfa", vmlinux)) return true; return false;