File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed
Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -70,9 +70,12 @@ tabstop_set(char_u *var, int **array)
7070 {
7171 int n = atoi ((char * )cp );
7272
73+ // Catch negative values, overflow and ridiculous big values.
7374 if (n < 0 || n > 9999 )
7475 {
7576 semsg (_ (e_invarg2 ), cp );
77+ vim_free (* array );
78+ * array = NULL ;
7679 return FAIL ;
7780 }
7881 (* array )[t ++ ] = n ;
@@ -1615,12 +1618,18 @@ ex_retab(exarg_T *eap)
16151618 else
16161619 new_ts_str = vim_strnsave (new_ts_str , eap -> arg - new_ts_str );
16171620#else
1618- new_ts = getdigits (& (eap -> arg ));
1619- if (new_ts < 0 )
1621+ ptr = eap -> arg ;
1622+ new_ts = getdigits (& ptr );
1623+ if (new_ts < 0 && * eap -> arg == '-' )
16201624 {
16211625 emsg (_ (e_positive ));
16221626 return ;
16231627 }
1628+ if (new_ts < 0 || new_ts > 9999 )
1629+ {
1630+ semsg (_ (e_invarg2 ), eap -> arg );
1631+ return ;
1632+ }
16241633 if (new_ts == 0 )
16251634 new_ts = curbuf -> b_p_ts ;
16261635#endif
Original file line number Diff line number Diff line change @@ -755,6 +755,8 @@ static char *(features[]) =
755755
756756static int included_patches [] =
757757{ /* Add new patch number below this line */
758+ /**/
759+ 3403 ,
758760/**/
759761 3402 ,
760762/**/
You can’t perform that action at this time.
0 commit comments