Explorar o código

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 %!s(int64=10) %!d(string=hai) anos
pai
achega
16e6de5153
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  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: