Specifiy that this supports M47
[platform/framework/web/crosswalk-tizen.git] / common / resource_manager.cc
old mode 100644 (file)
new mode 100755 (executable)
index 1dddd38..8881428
@@ -118,6 +118,9 @@ static bool CompareMime(const std::string& info_mime,
 
 static bool CompareUri(const std::string& info_uri,
                        const std::string& request_uri) {
+  if (info_uri == "*")
+    return true;
+
   if (request_uri.empty())
     return info_uri.empty();
 
@@ -516,12 +519,12 @@ bool ResourceManager::CheckAllowNavigation(const std::string& url) {
     bool prefix_wild = false;
     bool suffix_wild = false;
     std::string a_domain = a_domain_info.domain();
-    if (utils::StartsWith(a_domain, "*.")) {
+    if (utils::StartsWith(a_domain, "*")) {
       prefix_wild = true;
       // *.domain.com -> .domain.com
       a_domain = a_domain.substr(1);
     }
-    if (utils::EndsWith(a_domain, ".*")) {
+    if (utils::EndsWith(a_domain, "*")) {
       suffix_wild = true;
       // domain.* -> domain.
       a_domain = a_domain.substr(0, a_domain.length() - 1);
@@ -637,11 +640,11 @@ std::string ResourceManager::DecryptResource(const std::string& path) {
     int decrypted_size = 0;
 
     do {
-      unsigned char get_dec_size[4];
+      unsigned char get_dec_size[5];
       memset(get_dec_size, 0x00, sizeof(get_dec_size));
 
       size_t read_size =
-        fread(get_dec_size, sizeof(unsigned char), sizeof(get_dec_size), src);
+        fread(get_dec_size, 1, 4, src);
       if (0 != read_size) {
         unsigned int read_buf_size = 0;
         std::istringstream(std::string((char*)get_dec_size)) >> read_buf_size;
@@ -653,7 +656,7 @@ std::string ResourceManager::DecryptResource(const std::string& path) {
         in_chunk.reset(new unsigned char[read_buf_size]);
 
         size_t dec_read_size =
-          fread(in_chunk.get(), sizeof(unsigned char), read_buf_size, src);
+          fread(in_chunk.get(), 1, read_buf_size, src);
         if (0 != dec_read_size) {
           unsigned char* decrypted_data = nullptr;
           size_t decrypted_len = 0;