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: Petter Reinholdtsen
Subject: [Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_final-1869-g5524fc1
Date: Sat, 19 Apr 2014 12:56:47 +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  5524fc10e1c3e5420bf34bd22eba0905ef373e3e (commit)
      from  c1083e3aa60168f74779e0679e3c919c92fb6081 (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=5524fc10e1c3e5420bf34bd22eba0905ef373e3e


commit 5524fc10e1c3e5420bf34bd22eba0905ef373e3e
Author: Petter Reinholdtsen <address@hidden>
Date:   Sat Apr 19 14:50:59 2014 +0200

    Make it more clear that the 4 byte array in the file header is not
    supposed to be null terminated by using memcpy() instead strncpy()
    (Coverity CID 1149094).

diff --git a/libsound/WAVWriter.cpp b/libsound/WAVWriter.cpp
index dd1ce17..53c667a 100644
--- a/libsound/WAVWriter.cpp
+++ b/libsound/WAVWriter.cpp
@@ -19,7 +19,6 @@
 
 #include "WAVWriter.h"
 
-#include <cstring> // for strncpy
 #include <boost/cstdint.hpp>
 #include <fstream> // for composition (file_stream)
 #include <iostream> 
@@ -100,9 +99,10 @@ WAVWriter::write_wave_header(std::ofstream& outfile)
   CHUNK_HDR chk;
  
   // setup wav header
-  std::strncpy(wav.rID, "RIFF", 4);
-  std::strncpy(wav.wID, "WAVE", 4);
-  std::strncpy(wav.fId, "fmt ", 4);
+  // CID 1149094
+  std::memcpy(wav.rID, "RIFF", 4);
+  std::memcpy(wav.wID, "WAVE", 4);
+  std::memcpy(wav.fId, "fmt ", 4);
  
   wav.nBitsPerSample = 16;
   wav.nSamplesPerSec = 44100;
@@ -117,7 +117,7 @@ WAVWriter::write_wave_header(std::ofstream& outfile)
   wav.nBlockAlign = 2 * wav.nBitsPerSample / 8;
 
   // setup chunk header
-  std::strncpy(chk.dId, "data", 4);
+  std::memcpy(chk.dId, "data", 4);
   chk.dLen = 0;
  
   /* write riff/wav header */

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

Summary of changes:
 libsound/WAVWriter.cpp |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

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