1
0
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:
Wesley Shields 2013-10-10 17:34:34 +00:00
parent 0a9a0a511f
commit e08e76d049
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=330021
3 changed files with 24 additions and 0 deletions

View File

@ -2,6 +2,7 @@
PORTNAME= grok
PORTVERSION= 1.20110708.1
PORTREVISION= 1
PORTEPOCH= 1
CATEGORIES= sysutils
MASTER_SITES= GOOGLE_CODE

View 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();

View 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,