diff options
author | Wolfram Schneider <wosch@FreeBSD.org> | 2003-11-12 14:26:19 +0000 |
---|---|---|
committer | Wolfram Schneider <wosch@FreeBSD.org> | 2003-11-12 14:26:19 +0000 |
commit | 99703777c9b62e32e554dda29b81ae1e4a7a4a21 (patch) | |
tree | ddd282ab9f4ff5145aa81b5b048d01b7e11b55e2 /textproc/agrep | |
parent | 36c0b75c33f269e5492ac2e028874edf3dc32ddd (diff) |
Long patterns force a core dump:
$ ./agrep `perl -e 'print "y" x 240'` /dev/null
Segmentation fault (core dumped)
Notes
Notes:
svn path=/head/; revision=93819
Diffstat (limited to 'textproc/agrep')
-rw-r--r-- | textproc/agrep/files/patch-strncpy | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/textproc/agrep/files/patch-strncpy b/textproc/agrep/files/patch-strncpy new file mode 100644 index 000000000000..258f9af23f62 --- /dev/null +++ b/textproc/agrep/files/patch-strncpy @@ -0,0 +1,11 @@ +--- main.c 2003/11/12 14:09:11 1.1 ++++ main.c 2003/11/12 14:09:31 +@@ -751,7 +751,7 @@ + } + if (!(PAT_FILE) && Pattern[0] == '\0') { /* Pattern not set with -e option */ + if (argc == 0) usage(); +- strcpy(Pattern, *argv); ++ strncpy(Pattern, *argv, sizeof(Pattern)); + argc--; + argv++; + } |