coverity error handling 76/174876/2
authormallikarjun82 <vm.arjun@samsung.com>
Wed, 4 Apr 2018 13:52:32 +0000 (19:22 +0530)
committermallikarjun82 <vm.arjun@samsung.com>
Thu, 5 Apr 2018 04:56:53 +0000 (10:26 +0530)
This patch initializes variables to prevent from having garbage values.

Coverity: 108757, 107570, 107274, 105091

Change-Id: If0ea245e771508a92f75d897049c9a7ede97e5db
Signed-off-by: mallikarjun82 <vm.arjun@samsung.com>
common/url.cc
extensions/common/xwalk_extension_server.cc
runtime/browser/native_window.cc
runtime/browser/web_view_impl.cc

index 898190cc2e550827edbb4ef27cdfb7dafb2ef02e..4a91a9512f81ef85441cab1349ebc503d10666c5 100644 (file)
@@ -54,7 +54,7 @@ int GetDefaultPort(const std::string& scheme) {
 class URLImpl {
  public:
   explicit URLImpl(const std::string& url);
-  URLImpl() {}
+  URLImpl();
 
   std::string url() const { return url_; }
   std::string scheme() const { return scheme_; }
@@ -75,6 +75,9 @@ class URLImpl {
   void ExtractPath();
 };
 
+URLImpl::URLImpl() : port_(0) {
+}
+
 URLImpl::URLImpl(const std::string& url) : port_(0) {
   if (url.empty())
     return;
index fc503963783d312eac4ff3a2116f9b02a2a1e9c9..e895ce882e81d881442a81565b6ce24ebaf5554c 100755 (executable)
@@ -22,7 +22,8 @@ XWalkExtensionServer* XWalkExtensionServer::GetInstance() {
   return &self;
 }
 
-XWalkExtensionServer::XWalkExtensionServer() {
+XWalkExtensionServer::XWalkExtensionServer()
+    : ewk_context_(nullptr){
   manager_.LoadExtensions();
 }
 
index 1f2fde2f2c9e36203f67817ebc5a905dee9dd685..5bbbc4ddb52db4adfe28488682b6018b2a3d9980 100755 (executable)
@@ -79,7 +79,8 @@ NativeWindow::NativeWindow()
       progressbar_(NULL),
       top_layout_(NULL),
       rotation_(0),
-      handler_id_(0) {
+      handler_id_(0),
+      natural_orientation_(ScreenOrientation::LANDSCAPE_PRIMARY) {
 }
 
 NativeWindow::~NativeWindow() {
index 01050c5dc9d24f0c95874fcc0c142e93b970c354..83a535682abf17c2edd42980defec74ebc49647f 100755 (executable)
@@ -923,6 +923,8 @@ void WebViewImpl::InitEditorClientImeCallback() {
 
     SoftKeyboardChangeEventValue softkeyboard_value;
     softkeyboard_value.state = "off";
+    softkeyboard_value.width = 0;
+    softkeyboard_value.height = 0;
 
     self->listener_->OnSoftKeyboardChangeEvent(self->view_, softkeyboard_value);
   };