Thread (31 messages) flat view 31 messages, 3 authors, 2016-06-15

Re: [PATCH v2 4/6] connect: move error check to caller of parse_connect_url

From: Patrick Steinhardt <hidden>
Date: 2016-06-15 23:05:57

On Wed, Jul 29, 2015 at 04:32:13PM -0400, Eric Sunshine wrote:
On Wed, Jul 29, 2015 at 11:51 AM, Patrick Steinhardt [off-list ref] wrote:
quoted
parse_connect_url() checks if the path component of the URL is
empty and if so causes the program to die. As the function is to
be used at other call sites which do not require this check, move
up the error checking to the existing caller.

Signed-off-by: Patrick Steinhardt <redacted>
---
diff --git a/connect.c b/connect.c
index bdbcee4..e8b813d 100644
--- a/connect.c
+++ b/connect.c
@@ -613,9 +613,6 @@ enum protocol parse_connect_url(const char *url_orig, char **ret_host,
        else
                path = strchr(end, separator);

-       if (!path || !*path)
-               die("No path specified. See 'man git-pull' for valid url syntax");
-
Given that there are several dereferences of 'path' following this bit
of code, won't this change lead to a crash when path==NULL?
Correct, will fix, thanks.

Patrick

Attachments

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