瀏覽代碼

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 年之前
父節點
當前提交
16e6de5153
共有 1 個文件被更改,包括 5 次插入1 次删除
  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: