coverity error handling 83/200883/3
authordeepti <d.saraswat@samsung.com>
Tue, 5 Mar 2019 09:30:38 +0000 (15:00 +0530)
committerdeepti <d.saraswat@samsung.com>
Thu, 7 Mar 2019 07:07:41 +0000 (12:37 +0530)
This patch initializes variables to prevent from having garbage values.

Coverity: 108757, 105091

Reference : https://review.tizen.org/gerrit/#/c/platform/framework/web/crosswalk-tizen/+/174876/

Change-Id: Ic50d6d5ca42da40019c43e281eec3f5b962ff640
Signed-off-by: deepti <d.saraswat@samsung.com>
common/url.cc
runtime/browser/web_view_impl.cc

index 898190c..4a91a95 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 01050c5..83a5356 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);
   };