threads / patch / 11980

patchhttp.c: guard config parser from value=NULL

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

## tl;dr

3 messages between Feb 9, 2008 and Feb 9, 2008. Diffs are folded; open one to read it.

replies: 2people: 3as markdown or json

Govind Salinas· Feb 9, 2008, 00:39 UTC · lore
Signed-off-by: Govind Salinas <blix@sophiasuchtig.com>
---
 http.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
Show changes to http.c +3 −0
diff --git a/http.c b/http.c
index d2c11ae..0a2c1c8 100644
--- a/http.c
+++ b/http.c
@@ -92,6 +92,9 @@ static void process_curl_messages(void)

 static int http_options(const char *var, const char *value)
 {
+	if (!value)
+		return git_default_config(var, value);
+
 	if (!strcmp("http.sslverify", var)) {
 		if (curl_ssl_verify == -1) {
 			curl_ssl_verify = git_config_bool(var, value);
-- 
1.5.4.36.g9af61
Christian Couder· Feb 9, 2008, 17:46 UTC · re: Govind Salinas · lore

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

Le samedi 9 février 2008, Govind Salinas a écrit :
Show 19 quoted lines
> Signed-off-by: Govind Salinas <blix@sophiasuchtig.com>
> ---
>  http.c |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/http.c b/http.c
> index d2c11ae..0a2c1c8 100644
> --- a/http.c
> +++ b/http.c
> @@ -92,6 +92,9 @@ static void process_curl_messages(void)
>
>  static int http_options(const char *var, const char *value)
>  {
> +	if (!value)
> +		return git_default_config(var, value);
> +
>  	if (!strcmp("http.sslverify", var)) {
>  		if (curl_ssl_verify == -1) {
>  			curl_ssl_verify = git_config_bool(var, value);

After a very quick look at this, it seems that no change is needed here because 'git_config_bool' handles a NULL value correctly. Some changes may be needed below though.

Thanks, Christian.

Junio C Hamano· Feb 9, 2008, 21:09 UTC · re: Govind Salinas · lore

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

"Govind Salinas" <blix@sophiasuchtig.com> writes:
Show 19 quoted lines
> Signed-off-by: Govind Salinas <blix@sophiasuchtig.com>
> ---
>  http.c |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/http.c b/http.c
> index d2c11ae..0a2c1c8 100644
> --- a/http.c
> +++ b/http.c
> @@ -92,6 +92,9 @@ static void process_curl_messages(void)
>
>  static int http_options(const char *var, const char *value)
>  {
> +	if (!value)
> +		return git_default_config(var, value);
> +
>  	if (!strcmp("http.sslverify", var)) {
>  		if (curl_ssl_verify == -1) {
>  			curl_ssl_verify = git_config_bool(var, value);
I think this patch is wrong.
You just broke existing repositories with:
	[http]
        	sslverify
to set it to true.

← back to recent threads