Revision: 6673
          http://playerstage.svn.sourceforge.net/playerstage/?rev=6673&view=rev
Author:   thjc
Date:     2008-06-24 05:00:04 -0700 (Tue, 24 Jun 2008)

Log Message:
-----------
fixed uninitialised memory in array reallocation.

Modified Paths:
--------------
    code/player/branches/release-2-1-patches/libplayercore/filewatcher.cc

Modified: code/player/branches/release-2-1-patches/libplayercore/filewatcher.cc
===================================================================
--- code/player/branches/release-2-1-patches/libplayercore/filewatcher.cc       
2008-06-24 04:59:00 UTC (rev 6672)
+++ code/player/branches/release-2-1-patches/libplayercore/filewatcher.cc       
2008-06-24 12:00:04 UTC (rev 6673)
@@ -145,8 +145,10 @@
                if (next_entry == NULL)
                {
                        // otherwise we allocate some more room for the array
+                       size_t orig_size = WatchedFilesArraySize;
                        WatchedFilesArraySize*=2;
                        WatchedFiles = reinterpret_cast<struct fd_driver_pair 
*> (realloc(WatchedFiles,sizeof(WatchedFiles[0])*WatchedFilesArraySize));
+                       
memset(&WatchedFiles[orig_size],0,sizeof(WatchedFiles[0])*(WatchedFilesArraySize-orig_size));
                        next_entry = &WatchedFiles[WatchedFilesArrayCount];
 
                }


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Playerstage-commit mailing list
Playerstage-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/playerstage-commit

Reply via email to