gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_final-


From: Bastiaan Jacques
Subject: [Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_final-1888-g7fc4041
Date: Sun, 20 Apr 2014 22:28:13 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnash".

The branch, master has been updated
       via  7fc40410107c6c348fa18c5e726cf036d038a7b8 (commit)
       via  03eb3a2c145dbdb6d2869ce008483c772b9eff91 (commit)
      from  2644c937eaafe7a43534899511fbbd4b85946696 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit//commit/?id=7fc40410107c6c348fa18c5e726cf036d038a7b8


commit 7fc40410107c6c348fa18c5e726cf036d038a7b8
Author: Bastiaan Jacques <address@hidden>
Date:   Sun Apr 20 23:55:52 2014 +0200

    Silence Coverity 1149098 by making explicit the lack of need to
    check the return value of unload, because the only way to handle
    an unload failure is to call destroy, which is already done.

diff --git a/libcore/movie_root.cpp b/libcore/movie_root.cpp
index 3ec506c..efa5ddf 100644
--- a/libcore/movie_root.cpp
+++ b/libcore/movie_root.cpp
@@ -480,7 +480,7 @@ movie_root::dropLevel(int depth)
     }
 
     // TOCHECK: safe to erase here ?
-    mo->unload();
+    (void)mo->unload();
     mo->destroy();
     _movies.erase(it);
 

http://git.savannah.gnu.org/cgit//commit/?id=03eb3a2c145dbdb6d2869ce008483c772b9eff91


commit 03eb3a2c145dbdb6d2869ce008483c772b9eff91
Author: Bastiaan Jacques <address@hidden>
Date:   Sun Apr 20 23:30:10 2014 +0200

    Don't keep SOL files around if there was a problem writing them.

diff --git a/libcore/asobj/SharedObject_as.cpp 
b/libcore/asobj/SharedObject_as.cpp
index 81035f9..ef45151 100644
--- a/libcore/asobj/SharedObject_as.cpp
+++ b/libcore/asobj/SharedObject_as.cpp
@@ -341,45 +341,40 @@ SharedObject_as::flush(int space) const
     }
 
     if (rcfile.getSOLReadOnly()) {
-        log_security(_("Attempting to write object %s when it's SOL "
-                       "Read Only is set! Refusing..."), filespec);
-        return false;
-    }
-
-    // Open file
-    std::ofstream ofs(filespec.c_str(), std::ios::binary);
-    if (!ofs) {
-        log_error(_("SharedObject::flush(): Failed opening file '%s' in "
-                    "binary mode"), filespec.c_str());
+        log_security(_("Refusing attempt to write object %s while SOLreadonly "
+                       "is set!"), filespec);
         return false;
     }
 
     // Encode data part.
     SimpleBuffer buf;
     if (!encodeData(_name, *_data, buf)) {
-        std::remove(filespec.c_str());
         return true;
     }
 
     // Encode header part.
     SimpleBuffer header;
     encodeHeader(buf.size(), header);
-    
-    // Write header
-    ofs.write(reinterpret_cast<const char*>(header.data()), header.size());
+
+    std::ofstream ofs(filespec.c_str(), std::ios::binary);
     if (!ofs) {
-        log_error(_("Error writing SOL header"));
+        log_error(_("SharedObject::flush(): Failed opening file '%s' in binary"
+                    " mode"), filespec);
         return false;
     }
 
-    // Write AMF data
-    ofs.write(reinterpret_cast<const char*>(buf.data()), buf.size());
-    if (!ofs) {
-        log_error(_("Error writing %d bytes to output file %s"),
-                buf.size(), filespec.c_str());
+    bool success = ofs.write(reinterpret_cast<const char*>(header.data()), 
header.size())
+                   && ofs.write(reinterpret_cast<const char*>(buf.data()), 
buf.size());
+    ofs.close();
+
+    if (!success) {
+        log_error(_("Error writing AMF data to output file %s"), filespec);
+        if (std::remove(filespec.c_str()) != 0) {
+            log_error(_("Error removing SOL output file %s: %s"), filespec,
+                      strerror(errno));
+        }
         return false;
     }
-    ofs.close();
 
     log_security(_("SharedObject '%s' written to filesystem."), filespec);
     return true;

-----------------------------------------------------------------------

Summary of changes:
 libcore/asobj/SharedObject_as.cpp |   37 ++++++++++++++++---------------------
 libcore/movie_root.cpp            |    2 +-
 2 files changed, 17 insertions(+), 22 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

[Prev in Thread] Current Thread [Next in Thread]