flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mkess...@apache.org
Subject git commit: [flex-sdk] [refs/heads/develop] - FLEX-33710: Added index bounds checks.
Date Thu, 05 Sep 2013 00:48:36 GMT
Updated Branches:
  refs/heads/develop 4862c56fd -> b1d0359b6


FLEX-33710: Added index bounds checks.


Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/b1d0359b
Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/b1d0359b
Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/b1d0359b

Branch: refs/heads/develop
Commit: b1d0359b6368670e82a843cec9992260a968ca9a
Parents: 4862c56
Author: Mark Kessler <KesslerConsulting@gmail.com>
Authored: Wed Sep 4 20:46:14 2013 -0400
Committer: Mark Kessler <KesslerConsulting@gmail.com>
Committed: Wed Sep 4 20:46:14 2013 -0400

----------------------------------------------------------------------
 .../spark/src/spark/components/DataGrid.as      | 26 +++++++++++++++++---
 1 file changed, 23 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/b1d0359b/frameworks/projects/spark/src/spark/components/DataGrid.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/spark/src/spark/components/DataGrid.as b/frameworks/projects/spark/src/spark/components/DataGrid.as
index 54f005c..9fa5449 100644
--- a/frameworks/projects/spark/src/spark/components/DataGrid.as
+++ b/frameworks/projects/spark/src/spark/components/DataGrid.as
@@ -4769,6 +4769,20 @@ public class DataGrid extends SkinnableContainerBase
 	 */ 
 	protected function isCellEditable(rowIndex:int, columnIndex:int):Boolean
 	{
+        //
+        //  Index out of bounds tests.
+        //
+        if (columnIndex < 0 || rowIndex < 0)
+        {
+            return false;
+        }
+
+        if (columnIndex >= columnsLength || rowIndex >= dataProvider.length)
+        {
+            return false;
+        }
+
+
 		var dataItem:Object = dataProvider.getItemAt(rowIndex);
 		var column:GridColumn = GridColumn(columns.getItemAt(columnIndex));
 		var dataField:String = column.dataField;
@@ -5021,18 +5035,24 @@ public class DataGrid extends SkinnableContainerBase
         for each (var columnIndex:int in columnIndices)
         {
             var col:GridColumn = this.getColumnAt(columnIndex);
+
             if (!col || (!col.dataField && (col.labelFunction == null) &&
(col.sortCompareFunction == null)))
                 return null;
-            
+
             var dataField:String = col.dataField;
             var isComplexDataField:Boolean = (dataField && (dataField.indexOf(".")
!= -1));
             var sortField:ISortField = findSortField(dataField, previousFields, isComplexDataField);
             
             if (!sortField)
-                sortField = col.sortField;  // constructs a new sortField
+            {
+                //Constructs a new sortField from the columns own sortField property.
+                sortField = col.sortField;
+            }
             else
+            {
                 sortField.descending = col.sortDescending;
-            
+            }
+
             fields.push(sortField);
         }
         


Mime
View raw message