diff options
author | wxs <wxs@FreeBSD.org> | 2013-10-11 01:34:34 +0800 |
---|---|---|
committer | wxs <wxs@FreeBSD.org> | 2013-10-11 01:34:34 +0800 |
commit | 7bd5699ad855229c7a0a4d538cf330e9a1f34838 (patch) | |
tree | 8b3ab1385568d08d5e4c08f2e9ef4bc2a2420a13 | |
parent | 42b9275c6f7db42b21a2d8712c89619c4736cbc4 (diff) | |
download | freebsd-ports-gnome-7bd5699ad855229c7a0a4d538cf330e9a1f34838.tar.gz freebsd-ports-gnome-7bd5699ad855229c7a0a4d538cf330e9a1f34838.tar.zst freebsd-ports-gnome-7bd5699ad855229c7a0a4d538cf330e9a1f34838.zip |
Fix an infinite loop in discogrok.
PR: ports/182490
Submitted by: "Regis A. Despres" <regis.despres@gmail.com>
Obtained from: https://github.com/jordansissel/grok/commit/f1858bfa347bc79ad9aa6f3425edd3c19ffecf42
-rw-r--r-- | sysutils/grok/Makefile | 1 | ||||
-rw-r--r-- | sysutils/grok/files/patch-discover_main.c | 11 | ||||
-rw-r--r-- | sysutils/grok/files/patch-grok_discover.c | 12 |
3 files changed, 24 insertions, 0 deletions
diff --git a/sysutils/grok/Makefile b/sysutils/grok/Makefile index 9acddb574bca..7929ddafc946 100644 --- a/sysutils/grok/Makefile +++ b/sysutils/grok/Makefile @@ -2,6 +2,7 @@ PORTNAME= grok PORTVERSION= 1.20110708.1 +PORTREVISION= 1 PORTEPOCH= 1 CATEGORIES= sysutils MASTER_SITES= GOOGLE_CODE diff --git a/sysutils/grok/files/patch-discover_main.c b/sysutils/grok/files/patch-discover_main.c new file mode 100644 index 000000000000..7875f999292c --- /dev/null +++ b/sysutils/grok/files/patch-discover_main.c @@ -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(); diff --git a/sysutils/grok/files/patch-grok_discover.c b/sysutils/grok/files/patch-grok_discover.c new file mode 100644 index 000000000000..000e7c2d0707 --- /dev/null +++ b/sysutils/grok/files/patch-grok_discover.c @@ -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, |