shithub: gefs

Download patch

ref: 9884d4acb34576780f13e84d93551c93278b9212
parent: f2fb2cbdd516cfa3a27bd1ede173ec79aaaf80d8
author: Michael Forney <mforney@mforney.org>
date: Sun Oct 30 17:48:19 EDT 2022

cons: fix out-of-bounds access when given command without subcommand

--- a/cons.c
+++ b/cons.c
@@ -314,7 +314,7 @@
 				continue;
 			ap++; na--;
 			if(c->sub != nil){
-				if(strcmp(c->sub, *ap) != 0)
+				if(na == 0 || strcmp(c->sub, *ap) != 0)
 					continue;
 				ap++;
 				na--;