Browse Source

pygrass library: Crop strings longer than 2000 chars to avoid segfaults from lib/gis

git-svn-id: https://svn.osgeo.org/grass/grass/branches/releasebranch_7_0@62862 15284696-431f-4ddb-bdfa-cd5b030d7da7
Soeren Gebbert 10 years ago
parent
commit
16e6de5153
1 changed files with 5 additions and 1 deletions
  1. 5 1
      lib/python/pygrass/messages/__init__.py

+ 5 - 1
lib/python/pygrass/messages/__init__.py

@@ -76,7 +76,11 @@ def message_server(lock, conn):
             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: