mirror of
https://github.com/rfivet/uemacs.git
synced 2024-12-18 07:16:23 -05:00
Remove buffer overflow by limiting argument size of search pattern.
This commit is contained in:
parent
7b398855e7
commit
ccbd7d7099
3
main.c
3
main.c
@ -245,7 +245,8 @@ int main(int argc, char **argv)
|
|||||||
case 's': /* -s for initial search string */
|
case 's': /* -s for initial search string */
|
||||||
case 'S':
|
case 'S':
|
||||||
searchflag = TRUE;
|
searchflag = TRUE;
|
||||||
strncpy(pat, &argv[carg][2], NPAT);
|
strncpy( pat, &argv[ carg][ 2], NPAT - 1) ;
|
||||||
|
pat[ NPAT -1] = 0 ;
|
||||||
break;
|
break;
|
||||||
case 'v': /* -v for View File */
|
case 'v': /* -v for View File */
|
||||||
case 'V':
|
case 'V':
|
||||||
|
Loading…
Reference in New Issue
Block a user