File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -856,6 +856,9 @@ static ssize_t get_imix_entries(const char __user *buffer,
856
856
if (pkt_dev -> n_imix_entries >= MAX_IMIX_ENTRIES )
857
857
return - E2BIG ;
858
858
859
+ if (i >= maxlen )
860
+ return - EINVAL ;
861
+
859
862
max = min (10 , maxlen - i );
860
863
len = num_arg (& buffer [i ], max , & size );
861
864
if (len < 0 )
@@ -869,6 +872,8 @@ static ssize_t get_imix_entries(const char __user *buffer,
869
872
if (c != ',' )
870
873
return - EINVAL ;
871
874
i ++ ;
875
+ if (i >= maxlen )
876
+ return - EINVAL ;
872
877
873
878
if (size < 14 + 20 + 8 )
874
879
size = 14 + 20 + 8 ;
@@ -911,6 +916,9 @@ static ssize_t get_labels(const char __user *buffer,
911
916
if (n >= MAX_MPLS_LABELS )
912
917
return - E2BIG ;
913
918
919
+ if (i >= maxlen )
920
+ return - EINVAL ;
921
+
914
922
max = min (8 , maxlen - i );
915
923
len = hex32_arg (& buffer [i ], max , & tmp );
916
924
if (len < 0 )
You can’t perform that action at this time.
0 commit comments