git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] setup.c: guard config parser from value=NULL

From
Miklos Vajna <vmiklos@frugalware.org>
Date
Feb 8, 2008, 14:27 UTC
Message-ID
<20080208142702.GY25954@genesis.frugalware.org>
In-Reply-To
<7v63x0lzhw.fsf@gitster.siamese.dyndns.org>
Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
---
 setup.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/setup.c b/setup.c
index adede16..361825f 100644
--- a/setup.c
+++ b/setup.c
@@ -346,13 +346,13 @@ int git_config_perm(const char *var, const char *value)
 {
 	if (value) {
 		int i;
-		if (!strcmp(value, "umask"))
+		if (value && !strcmp(value, "umask"))
 			return PERM_UMASK;
-		if (!strcmp(value, "group"))
+		if (value && !strcmp(value, "group"))
 			return PERM_GROUP;
-		if (!strcmp(value, "all") ||
+		if (value && (!strcmp(value, "all") ||
 		    !strcmp(value, "world") ||
-		    !strcmp(value, "everybody"))
+		    !strcmp(value, "everybody")))
 			return PERM_EVERYBODY;
 		i = atoi(value);
 		if (i > 1)
-- 
1.5.4
Previous: Michele BallabioNext: Michele Ballabio
Message 6 of 15 in “[Janitors] value could be NULL in config parser”
  1. Junio C HamanoFeb 8, 2008
  2. archive-tar.c: guard config parser from value=NULLMiklos Vajna, Feb 8, 2008
  3. builtin-gc.c: guard config parser from value=NULLMiklos Vajna, Feb 8, 2008
  4. remote.c: guard config parser from value=NULLMiklos Vajna, Feb 8, 2008
  5. Michele BallabioFeb 8, 2008
  6. setup.c: guard config parser from value=NULLMiklos Vajna, Feb 8, 2008
  7. Michele BallabioFeb 8, 2008
  8. Miklos VajnaFeb 8, 2008
  9. Govind SalinasFeb 8, 2008
  10. Govind SalinasFeb 9, 2008
  11. Christian CouderFeb 9, 2008
  12. Junio C HamanoFeb 9, 2008
  13. Christian CouderFeb 9, 2008
  14. Christian CouderFeb 9, 2008
  15. Govind SalinasFeb 9, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.