Update of /cvsroot/mahogany/M/src/classes
In directory sc8-pr-cvs1:/tmp/cvs-serv19827/src/classes
Modified Files:
MApplication.cpp
Log Message:
reall fixed (relatively harmless) uninitialized memory reading bug
Index: MApplication.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/classes/MApplication.cpp,v
retrieving revision 1.271
retrieving revision 1.272
diff -b -u -2 -r1.271 -r1.272
--- MApplication.cpp 12 Jul 2003 19:00:15 -0000 1.271
+++ MApplication.cpp 12 Jul 2003 19:02:40 -0000 1.272
@@ -1247,8 +1247,20 @@
if ( m_statusPanes[n] == field )
{
+ // remove this field and shift the remaining ones (don't use memmove()
+ // to avoid reading uninitialized memory and provoking Purify ire...)
for ( size_t m = n + 1; m <= WXSIZEOF(m_statusPanes); m++ )
{
- m_statusPanes[m - 1] =
- m == WXSIZEOF(m_statusPanes) ? SF_ILLEGAL : m_statusPanes[m];
+ if ( m == WXSIZEOF(m_statusPanes) )
+ {
+ m_statusPanes[m - 1] = SF_ILLEGAL;
+ }
+ else
+ {
+ if ( (m_statusPanes[m - 1] = m_statusPanes[m]) == SF_ILLEGAL )
+ {
+ // no more fields
+ break;
+ }
+ }
}
-------------------------------------------------------
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing & more.
Download & eval WebKing and get a free book.
www.parasoft.com/bulletproofapps1
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates