You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by rp...@apache.org on 2019/03/18 09:19:54 UTC

svn commit: r1855743 - /httpd/httpd/trunk/server/util.c

Author: rpluem
Date: Mon Mar 18 09:19:54 2019
New Revision: 1855743

URL: http://svn.apache.org/viewvc?rev=1855743&view=rev
Log:
* Play safe in case we get no name

Modified:
    httpd/httpd/trunk/server/util.c

Modified: httpd/httpd/trunk/server/util.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/util.c?rev=1855743&r1=1855742&r2=1855743&view=diff
==============================================================================
--- httpd/httpd/trunk/server/util.c (original)
+++ httpd/httpd/trunk/server/util.c Mon Mar 18 09:19:54 2019
@@ -573,6 +573,10 @@ AP_DECLARE(void) ap_no2slash_ex(char *na
 
     char *d, *s;
 
+    if (!name || !*name) {
+        return;
+    }
+
     s = d = name;
 
 #ifdef HAVE_UNC_PATHS



Re: svn commit: r1855743 - /httpd/httpd/trunk/server/util.c

Posted by Stefan Eissing <st...@greenbytes.de>.
The question is, should our buildbot detect those things?

> Am 18.03.2019 um 13:46 schrieb Ruediger Pluem <rp...@apache.org>:
> 
> 
> 
> On 03/18/2019 01:42 PM, Ruediger Pluem wrote:
>> 
>> 
>> On 03/18/2019 01:22 PM, Eric Covener wrote:
>>> I just found that this is a compile error on my mac w/ maintainer mode
>>> due to __attribute__((nonnull))
>>> util.c:576:10: error: nonnull parameter 'name' will evaluate to 'true'
>>> on first encounter [-Werror,-Wpointer-bool-conversion]
>> 
>> Hm. I guess my RedHat 6 compiler is too old and no maintainer mode used. Hence I did not catch that.
>> So should we just revert r1855743 (unfortunately in 2.4.x then as well :-( ) and put the NULL checking
>> burden on the caller? I guess in the specific case here where it caused the segfault we are safe
>> as r1855744 catches that.
> 
> Ok, r1855755 is even better :-)
> Voted on it. Hopefully everything is fine now.
> 
> Regards
> 
> Rüdiger
> 
> 


Re: svn commit: r1855743 - /httpd/httpd/trunk/server/util.c

Posted by Ruediger Pluem <rp...@apache.org>.

On 03/18/2019 01:42 PM, Ruediger Pluem wrote:
> 
> 
> On 03/18/2019 01:22 PM, Eric Covener wrote:
>> I just found that this is a compile error on my mac w/ maintainer mode
>> due to __attribute__((nonnull))
>> util.c:576:10: error: nonnull parameter 'name' will evaluate to 'true'
>> on first encounter [-Werror,-Wpointer-bool-conversion]
> 
> Hm. I guess my RedHat 6 compiler is too old and no maintainer mode used. Hence I did not catch that.
> So should we just revert r1855743 (unfortunately in 2.4.x then as well :-( ) and put the NULL checking
> burden on the caller? I guess in the specific case here where it caused the segfault we are safe
> as r1855744 catches that.

Ok, r1855755 is even better :-)
Voted on it. Hopefully everything is fine now.

Regards

Rüdiger



Re: svn commit: r1855743 - /httpd/httpd/trunk/server/util.c

Posted by Ruediger Pluem <rp...@apache.org>.

On 03/18/2019 01:22 PM, Eric Covener wrote:
> I just found that this is a compile error on my mac w/ maintainer mode
> due to __attribute__((nonnull))
> util.c:576:10: error: nonnull parameter 'name' will evaluate to 'true'
> on first encounter [-Werror,-Wpointer-bool-conversion]

Hm. I guess my RedHat 6 compiler is too old and no maintainer mode used. Hence I did not catch that.
So should we just revert r1855743 (unfortunately in 2.4.x then as well :-( ) and put the NULL checking
burden on the caller? I guess in the specific case here where it caused the segfault we are safe
as r1855744 catches that.

Regards

Rüdiger

> 
>     if (!name || !*name) {
> 
> On Mon, Mar 18, 2019 at 5:19 AM <rp...@apache.org> wrote:
>>
>> Author: rpluem
>> Date: Mon Mar 18 09:19:54 2019
>> New Revision: 1855743
>>
>> URL: http://svn.apache.org/viewvc?rev=1855743&view=rev
>> Log:
>> * Play safe in case we get no name
>>
>> Modified:
>>     httpd/httpd/trunk/server/util.c
>>
>> Modified: httpd/httpd/trunk/server/util.c
>> URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/util.c?rev=1855743&r1=1855742&r2=1855743&view=diff
>> ==============================================================================
>> --- httpd/httpd/trunk/server/util.c (original)
>> +++ httpd/httpd/trunk/server/util.c Mon Mar 18 09:19:54 2019
>> @@ -573,6 +573,10 @@ AP_DECLARE(void) ap_no2slash_ex(char *na
>>
>>      char *d, *s;
>>
>> +    if (!name || !*name) {
>> +        return;
>> +    }
>> +
>>      s = d = name;
>>
>>  #ifdef HAVE_UNC_PATHS
>>
>>
> 
> 

Re: svn commit: r1855743 - /httpd/httpd/trunk/server/util.c

Posted by Eric Covener <co...@gmail.com>.
I just found that this is a compile error on my mac w/ maintainer mode
due to __attribute__((nonnull))
util.c:576:10: error: nonnull parameter 'name' will evaluate to 'true'
on first encounter [-Werror,-Wpointer-bool-conversion]

    if (!name || !*name) {

On Mon, Mar 18, 2019 at 5:19 AM <rp...@apache.org> wrote:
>
> Author: rpluem
> Date: Mon Mar 18 09:19:54 2019
> New Revision: 1855743
>
> URL: http://svn.apache.org/viewvc?rev=1855743&view=rev
> Log:
> * Play safe in case we get no name
>
> Modified:
>     httpd/httpd/trunk/server/util.c
>
> Modified: httpd/httpd/trunk/server/util.c
> URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/util.c?rev=1855743&r1=1855742&r2=1855743&view=diff
> ==============================================================================
> --- httpd/httpd/trunk/server/util.c (original)
> +++ httpd/httpd/trunk/server/util.c Mon Mar 18 09:19:54 2019
> @@ -573,6 +573,10 @@ AP_DECLARE(void) ap_no2slash_ex(char *na
>
>      char *d, *s;
>
> +    if (!name || !*name) {
> +        return;
> +    }
> +
>      s = d = name;
>
>  #ifdef HAVE_UNC_PATHS
>
>


-- 
Eric Covener
covener@gmail.com