CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Benjamin Wolsey <bwy>   08/02/10 21:12:25

Modified files:
        .              : ChangeLog 
        libbase        : rc.cpp 

Log message:
        * libbase/rc.cpp: Fix a nice buffer overrun arising from long
          comments in the rcfile.
        
        Hm.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.5608&r2=1.5609
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/rc.cpp?cvsroot=gnash&r1=1.58&r2=1.59

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.5608
retrieving revision 1.5609
diff -u -b -r1.5608 -r1.5609
--- ChangeLog   10 Feb 2008 18:28:20 -0000      1.5608
+++ ChangeLog   10 Feb 2008 21:12:24 -0000      1.5609
@@ -2,6 +2,8 @@
 
        * gui/gtk.cpp: Don't use is_muted() to set the 'Sound' menu toggle,
          as the function seems to have changed.
+       * libbase/rc.cpp: Fix a nice buffer overrun arising from long
+         comments in the rcfile.
 
 2008-02-10 Bastiaan Jacques <[EMAIL PROTECTED]>
 

Index: libbase/rc.cpp
===================================================================
RCS file: /sources/gnash/gnash/libbase/rc.cpp,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -b -r1.58 -r1.59
--- libbase/rc.cpp      31 Jan 2008 15:17:10 -0000      1.58
+++ libbase/rc.cpp      10 Feb 2008 21:12:25 -0000      1.59
@@ -364,7 +364,7 @@
         }
         
         // Read in each line and parse it
-        do {
+        while (!in.eof()) {
 
            // Make sure action is empty, otherwise the last loop (with no new
            // data) keeps action, variable and value from the previous loop. 
This
@@ -378,8 +378,8 @@
             // Ignore comment lines
             if (action[0] == '#') {
                 // suck up the rest of the line
-                char name[128];
-                in.getline(name, 128);
+                std::string discard;
+                getline(in, discard);
                 continue;
             } 
             
@@ -490,7 +490,7 @@
                      extractNumber((boost::uint32_t *)&_lcshmkey, "LCShmkey", 
variable, value);
                }
             }
-        } while (!in.eof());
+        }
 
     } else {
         if (in) {


_______________________________________________
Gnash-commit mailing list
Gnash-commit@gnu.org
http://lists.gnu.org/mailman/listinfo/gnash-commit

Reply via email to