DORMANTno replies

[PATCH] Fix segfault in git-shell when given no argument.

From: Tommi Virtanen <hidden>
Date: 2016-06-15 22:42:13
Subsystem: the rest · Maintainer: Linus Torvalds

The bug is trivially reproducible with "git-shell -c git-receive-pack"

Signed-off-by: Tommi Virtanen <redacted>

---

 shell.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

applies-to: 2ada0cb8fce070b6b2c56fa689791230636f1857
4fbfea212a9afcd123a213e20388b1fa775fc7fe
diff --git a/shell.c b/shell.c
index 2c4789e..7fab432 100644
--- a/shell.c
+++ b/shell.c
@@ -5,6 +5,8 @@ static int do_generic_cmd(const char *me
 {
 	const char *my_argv[4];
 
+	if (!arg)
+		die("missing argument");
 	arg = sq_dequote(arg);
 	if (!arg)
 		die("bad argument");
---
0.99.9.GIT
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help