[GRASS-SVN] r62862 - grass/branches/releasebranch_7_0/lib/python/pygrass/messages

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Nov 22 14:27:27 PST 2014


Author: huhabla
Date: 2014-11-22 14:27:27 -0800 (Sat, 22 Nov 2014)
New Revision: 62862

Modified:
   grass/branches/releasebranch_7_0/lib/python/pygrass/messages/__init__.py
Log:
pygrass library: Crop strings longer than 2000 chars to avoid segfaults from lib/gis

Modified: grass/branches/releasebranch_7_0/lib/python/pygrass/messages/__init__.py
===================================================================
--- grass/branches/releasebranch_7_0/lib/python/pygrass/messages/__init__.py	2014-11-22 22:19:47 UTC (rev 62861)
+++ grass/branches/releasebranch_7_0/lib/python/pygrass/messages/__init__.py	2014-11-22 22:27:27 UTC (rev 62862)
@@ -76,11 +76,15 @@
             libgis.G_debug(1, "Stop messenger server")
             sys.exit()
 
-        message = data[1]
+        message = data[1]            
         # libgis limitation
         if isinstance(message,  type(" ")):
             if len(message) >= 2000:
                 message = message[:1999]
+        # libgis limitation
+        if isinstance(message,  type(" ")):
+            if len(message) >= 2000:
+                message = message[:1999]
 
         if message_type == "PERCENT":
             n = int(data[1])



More information about the grass-commit mailing list