Revision: 5776
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5776&view=rev
Author:   mdboom
Date:     2008-07-17 18:25:20 +0000 (Thu, 17 Jul 2008)

Log Message:
-----------
Remove possibility of buffer overrun in last commit.

Modified Paths:
--------------
    trunk/matplotlib/src/agg_py_path_iterator.h

Modified: trunk/matplotlib/src/agg_py_path_iterator.h
===================================================================
--- trunk/matplotlib/src/agg_py_path_iterator.h 2008-07-17 17:40:47 UTC (rev 
5775)
+++ trunk/matplotlib/src/agg_py_path_iterator.h 2008-07-17 18:25:20 UTC (rev 
5776)
@@ -75,14 +75,18 @@
     {
         if (m_iterator >= m_total_vertices) return agg::path_cmd_stop;
         unsigned code = vertex_with_code(m_iterator++, x, y);
+
         if (MPL_isnan64(*x) || MPL_isnan64(*y)) {
-          do {
-            vertex(m_iterator++, x, y);
-          } while ((MPL_isnan64(*x) || MPL_isnan64(*y)) &&
-                   m_iterator < m_total_vertices);
-          return (m_iterator >= m_total_vertices) ? agg::path_cmd_stop :
-                                                    agg::path_cmd_move_to;
+            do {
+                if (m_iterator < m_total_vertices) {
+                    vertex(m_iterator++, x, y);
+                } else {
+                    return agg::path_cmd_stop;
+                }
+            } while (MPL_isnan64(*x) || MPL_isnan64(*y));
+            return agg::path_cmd_move_to;
         }
+
         return code;
     }
 


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

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins

Reply via email to