diff --git a/plugin/rewrite/rewrite.go b/plugin/rewrite/rewrite.go
index <HASH>..<HASH> 100644
--- a/plugin/rewrite/rewrite.go
+++ b/plugin/rewrite/rewrite.go
@@ -100,6 +100,9 @@ func newRule(args ...string) (Rule, error) {
 	switch arg0 {
 	case Continue:
 		mode = Continue
+		if len(args) < 2 {
+			return nil, fmt.Errorf("continue rule must begin with a rule type")
+		}
 		ruleType = strings.ToLower(args[1])
 		expectNumArgs = len(args) - 1
 		startArg = 2
diff --git a/plugin/rewrite/setup_test.go b/plugin/rewrite/setup_test.go
index <HASH>..<HASH> 100644
--- a/plugin/rewrite/setup_test.go
+++ b/plugin/rewrite/setup_test.go
@@ -33,6 +33,7 @@ func TestParse(t *testing.T) {
     name regex foo bar
 }`, true, "must begin with a name rule"},
 		{`rewrite stop`, true, ""},
+		{`rewrite continue`, true, ""},
 	}
 
 	for i, test := range tests {
Fix out-of-index issue in rewrite plugin (#<I>)

This PR fixes another out-of-index issue in rewrite to avoid

security vuln.