From: Eunki, Hong Date: Mon, 19 Dec 2022 19:47:49 +0000 (+0900) Subject: Fix svace issue - Application Destructor & egl controller debug X-Git-Tag: dali_2.2.7~5^2 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git;a=commitdiff_plain;h=0a3f16f43e60012050c8c693da4df027a7dc1adc Fix svace issue - Application Destructor & egl controller debug - Make Internal::Application virtual destructor - Only if Debug enabled can use GraphicsFrameDump struct. It will guard some getenv + fopen vulnerable operation. Change-Id: I7cfb79b4aa270d856bd9668aa0b882d43819aa70 Signed-off-by: Eunki, Hong --- diff --git a/dali/internal/adaptor/common/application-impl.h b/dali/internal/adaptor/common/application-impl.h index 700f3a2..2b2e872 100644 --- a/dali/internal/adaptor/common/application-impl.h +++ b/dali/internal/adaptor/common/application-impl.h @@ -466,7 +466,7 @@ protected: /** * Destructor */ - ~Application() override; + virtual ~Application() override; // Undefined Application(const Application&); diff --git a/dali/internal/graphics/gles-impl/egl-graphics-controller-debug.cpp b/dali/internal/graphics/gles-impl/egl-graphics-controller-debug.cpp index 4ac58ae..822821a 100644 --- a/dali/internal/graphics/gles-impl/egl-graphics-controller-debug.cpp +++ b/dali/internal/graphics/gles-impl/egl-graphics-controller-debug.cpp @@ -20,6 +20,7 @@ namespace Dali::Graphics { +#if defined(DEBUG_ENABLED) std::string DumpCompareOp(Graphics::CompareOp compareOp) { switch(compareOp) @@ -369,5 +370,5 @@ bool GraphicsFrameDump::IsDumpFrame() return dump; } - +#endif } // namespace Dali::Graphics diff --git a/dali/internal/graphics/gles-impl/egl-graphics-controller-debug.h b/dali/internal/graphics/gles-impl/egl-graphics-controller-debug.h index c6333f4..ef26df4 100644 --- a/dali/internal/graphics/gles-impl/egl-graphics-controller-debug.h +++ b/dali/internal/graphics/gles-impl/egl-graphics-controller-debug.h @@ -2,7 +2,7 @@ #define DALI_GRAPHICS_EGL_GRAPHICS_CONTROLLER_DEBUG_H /* - * Copyright (c) 2021 Samsung Electronics Co., Ltd. + * Copyright (c) 2022 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,10 +21,11 @@ namespace Dali::Graphics { +#if defined(DEBUG_ENABLED) /** - * Struct to manage dumping N command buffers. In this file, "frame" really + * Struct to manage dumping N command buffers. In this file, "frame" really * means each call to EglGraphicsController::Flush(), and doesn't necessarily - * correspond to a complete render frame. + * correspond to a complete render frame. */ struct GraphicsFrameDump { @@ -46,6 +47,7 @@ struct GraphicsFrameDump void DumpCommandBuffer(const GLES::CommandBuffer* cmdBuf); bool IsDumpFrame(); }; +#endif #if defined(DEBUG_ENABLED) && defined(ENABLE_COMMAND_BUFFER_FRAME_DUMP) #define DUMP_FRAME_INIT() std::unique_ptr gGraphicsFrameDump(new Dali::Graphics::GraphicsFrameDump)