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

3 messages from 2008-02-09 to 2008-02-09. Participants: Govind Salinas, Christian Couder, Junio C Hamano.
Thread: https://gitlist.dev/t/11980

## Govind Salinas, 2008-02-09 00:39

Subject: [PATCH] http.c: guard config parser from value=NULL
Message-ID: <5d46db230802081639n78aab3b2s1e83ab9c4afc6a38@mail.gmail.com>
URL: https://gitlist.dev/e/5d46db230802081639n78aab3b2s1e83ab9c4afc6a38%40mail.gmail.com

```
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);
-- 
1.5.4.36.g9af61

```

## Christian Couder, 2008-02-09 17:46

Subject: Re: [PATCH] http.c: guard config parser from value=NULL
Message-ID: <200802091846.26708.chriscool@tuxfamily.org>
URL: https://gitlist.dev/e/200802091846.26708.chriscool%40tuxfamily.org
In-Reply-To: <5d46db230802081639n78aab3b2s1e83ab9c4afc6a38@mail.gmail.com>

```
Le samedi 9 février 2008, Govind Salinas a écrit :
> 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, 2008-02-09 21:09

Subject: Re: [PATCH] http.c: guard config parser from value=NULL
Message-ID: <7vabm9et0x.fsf@gitster.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vabm9et0x.fsf%40gitster.siamese.dyndns.org
In-Reply-To: <5d46db230802081639n78aab3b2s1e83ab9c4afc6a38@mail.gmail.com>

```
"Govind Salinas" <blix@sophiasuchtig.com> writes:

> 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.

```
