Fix svace issue - Application Destructor & egl controller debug 62/285762/2
authorEunki, Hong <eunkiki.hong@samsung.com>
Mon, 19 Dec 2022 19:47:49 +0000 (04:47 +0900)
committerEunki, Hong <eunkiki.hong@samsung.com>
Mon, 19 Dec 2022 20:08:39 +0000 (05:08 +0900)
 - 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 <eunkiki.hong@samsung.com>
dali/internal/adaptor/common/application-impl.h
dali/internal/graphics/gles-impl/egl-graphics-controller-debug.cpp
dali/internal/graphics/gles-impl/egl-graphics-controller-debug.h

index 700f3a2..2b2e872 100644 (file)
@@ -466,7 +466,7 @@ protected:
   /**
    * Destructor
    */
-  ~Application() override;
+  virtual ~Application() override;
 
   // Undefined
   Application(const Application&);
index 4ac58ae..822821a 100644 (file)
@@ -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
index c6333f4..ef26df4 100644 (file)
@@ -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.
 
 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<Dali::Graphics::GraphicsFrameDump> gGraphicsFrameDump(new Dali::Graphics::GraphicsFrameDump)