Thread (24 messages) flat view 24 messages, 6 authors, 2016-06-15

Re: [PATCH 04/10] config: avoid segfault when parsing command-line config

From: Jeff King <hidden>
Date: 2016-06-15 22:51:28

On Mon, Jun 13, 2011 at 10:30:22AM -0700, Junio C Hamano wrote:
quoted
+	if (!pair[0])
+		return error("bogus config parameter: %s", text);
This feels wrong.

Asking strbuf_split() to split a string "foo" with "=" delimiter would
give you one element array ("foo", NULL), a string "fo" would give you
("fo", NULL), and a string "f" would give you ("f", NULL).  Shouldn't we
get ("", NULL) if we ask it to split ""?
Yeah, I was making the assumption that strbuf_split was not bugging, and
coding to its output. But I think you are right, that it is simply
returning bogus output.

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help