octave-maintainers
[Top][All Lists]
Advanced

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

MSVC patch: memory corruption in load-path.cc


From: michael . goffioul
Subject: MSVC patch: memory corruption in load-path.cc
Date: Thu, 09 Nov 2006 15:24:53 +0100

While debugging with Visual Studio, the debugger reported a memory corruption
problem in load-path.cc. The following patch fixes it. As "fi" is not copied from "*p",
it still points to memory that has been freed by the "erase" statement.
 
Michael.
 
Index: src/load-path.cc
===================================================================
RCS file: /cvs/octave/src/load-path.cc,v
retrieving revision 1.10
diff -c -p -r1.10 load-path.cc
*** src/load-path.cc    28 Oct 2006 00:13:59 -0000      1.10
--- src/load-path.cc    9 Nov 2006 14:22:31 -0000
*************** load_path::move (dir_info_list_iterator
*** 325,331 ****
                {
                  if (p->dir_name == dir)
                    {
!                     file_info& fi = *p;
 
                      file_info_list.erase (p);
 
--- 325,331 ----
                {
                  if (p->dir_name == dir)
                    {
!                     file_info fi = *p;
 
                      file_info_list.erase (p);


reply via email to

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