shithub: riscv

Download patch

ref: 5692962407eb0bfdae8e91255e3f53c3fb6a7468
parent: 014b9a62ac919b4f7ada38b8649f6a4a062cd207
author: Ori Bernstein <ori@eigenstate.org>
date: Sat Oct 14 14:00:26 EDT 2023

git/query: check for nil return from seprint

--- a/sys/src/cmd/git/query.c
+++ b/sys/src/cmd/git/query.c
@@ -180,7 +180,8 @@
 	p = query;
 	e = query + nelem(query);
 	for(i = 0; i < argc; i++){
-		p = seprint(p, e, "%s%s", s, argv[i]);
+		if((p = seprint(p, e, "%s%s", s, argv[i])) == nil)
+			sysfatal("query too long");
 		s = " ";
 	}
 	if((n = resolverefs(&h, query)) == -1)