Fix T47252: FileBrowser: buffer overflow with scripts defining too long 'filter_glob' string.

Fixed this with three changes:
* filter_glob is now 255 char max (63 could be a bit limited in some rare cases).
* IO templates now explicitely define max len of that property (such that scripters are aware of the limit).
* ED_fileselect_set_params() is now safe regarding too long strings from a 'filter_glob' op property.
This commit is contained in:
Bastien Montagne
2016-01-27 18:04:50 +01:00
parent 4e2eea63a4
commit 66aa4af836
5 changed files with 11 additions and 3 deletions

View File

@@ -28,6 +28,7 @@ class ExportSomeData(Operator, ExportHelper):
filter_glob = StringProperty(
default="*.txt",
options={'HIDDEN'},
maxlen=255, # Max internal buffer length, longer would be clamped.
)
# List of operator properties, the attributes will be assigned

View File

@@ -31,6 +31,7 @@ class ImportSomeData(Operator, ImportHelper):
filter_glob = StringProperty(
default="*.txt",
options={'HIDDEN'},
maxlen=255, # Max internal buffer length, longer would be clamped.
)
# List of operator properties, the attributes will be assigned