From patchwork Fri May 3 02:52:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 19992 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id AFF9CC328F for ; Fri, 3 May 2024 02:52:16 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4F00F6340B; Fri, 3 May 2024 04:52:16 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="KVUra0bQ"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 33C626341A for ; Fri, 3 May 2024 04:52:14 +0200 (CEST) Received: from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi [81.175.209.231]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id D079E3A3 for ; Fri, 3 May 2024 04:51:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1714704676; bh=I0jKV3ql9fIdXigKZR1o5tB91xRbqDt7ytaH9cYvNj8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=KVUra0bQPLXI4lNYs9JP57WUVMR8DBX8j/IAOol9TzTErh28jsZcy1K/OlMNCGoyo b+XjqjwnTJEh+XZyH3hCQ4/2psUbMjjdrN3N4vRc9mPTzaNoWIPLKdFakzugSz4op8 NOcQavl/gVo84Svj4XlQgch0LP524X0OpB5cL338= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Subject: [PATCH 1/4] libcamera: utils: Avoid infinite recursion with strtod() Date: Fri, 3 May 2024 05:52:02 +0300 Message-ID: <20240503025205.2814-2-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240503025205.2814-1-laurent.pinchart@ideasonboard.com> References: <20240503025205.2814-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" When the C library doesn't provide local object support, the utils::strtod() function simply calls strtod() from the C library. The current implementation does so incorrectly, and calls utils::strtod() instead, resulting in infinite recursion. Fix it with a proper namespace qualifier. Signed-off-by: Laurent Pinchart Reviewed-by: Umang Jain Reviewed-by: Stefan Klug --- src/libcamera/base/utils.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libcamera/base/utils.cpp b/src/libcamera/base/utils.cpp index 2f4c3177ac13..96023f992e03 100644 --- a/src/libcamera/base/utils.cpp +++ b/src/libcamera/base/utils.cpp @@ -517,7 +517,7 @@ double strtod(const char *__restrict nptr, char **__restrict endptr) * If the libc implementation doesn't provide locale object support, * assume that strtod() is locale-independent. */ - return strtod(nptr, endptr); + return ::strtod(nptr, endptr); #endif }