mirror of
https://git.FreeBSD.org/ports.git
synced 2024-12-23 04:23:08 +00:00
Fix an infinite loop in discogrok.
PR: ports/182490
Submitted by: "Regis A. Despres" <regis.despres@gmail.com>
Obtained from: f1858bfa34
This commit is contained in:
parent
0a9a0a511f
commit
e08e76d049
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=330021
@ -2,6 +2,7 @@
|
||||
|
||||
PORTNAME= grok
|
||||
PORTVERSION= 1.20110708.1
|
||||
PORTREVISION= 1
|
||||
PORTEPOCH= 1
|
||||
CATEGORIES= sysutils
|
||||
MASTER_SITES= GOOGLE_CODE
|
||||
|
11
sysutils/grok/files/patch-discover_main.c
Normal file
11
sysutils/grok/files/patch-discover_main.c
Normal file
@ -0,0 +1,11 @@
|
||||
--- ./discover_main.c.orig 2013-10-10 13:25:59.000000000 -0400
|
||||
+++ ./discover_main.c 2013-10-10 13:26:13.000000000 -0400
|
||||
@@ -33,7 +33,7 @@
|
||||
grok_init(&grok);
|
||||
|
||||
int pattern_count = 0;
|
||||
- while ((opt = getopt_long_only(argc, argv, "hp:v", options, &optind)) != -1) {
|
||||
+ while ((opt = getopt_long_only(argc, argv, "hp:v", options, NULL)) != -1) {
|
||||
switch (opt) {
|
||||
case 'h':
|
||||
usage();
|
12
sysutils/grok/files/patch-grok_discover.c
Normal file
12
sysutils/grok/files/patch-grok_discover.c
Normal file
@ -0,0 +1,12 @@
|
||||
--- ./grok_discover.c.orig 2013-10-10 13:26:22.000000000 -0400
|
||||
+++ ./grok_discover.c 2013-10-10 13:27:24.000000000 -0400
|
||||
@@ -187,6 +187,9 @@
|
||||
if (first_match_endpos > 0) {
|
||||
offset += first_match_endpos;
|
||||
}
|
||||
+ else {
|
||||
+ offset += 1;
|
||||
+ }
|
||||
} else { /* We found a match, replace it in the pattern */
|
||||
grok_log(gdt, LOG_DISCOVER, "%d: Matched %s on '%.*s'",
|
||||
rounds, best_match.grok->pattern,
|
Loading…
Reference in New Issue
Block a user