You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2017/03/08 11:53:48 UTC

[Bug 60836] New: errno not inited before strtol

https://bz.apache.org/bugzilla/show_bug.cgi?id=60836

            Bug ID: 60836
           Summary: errno not inited before strtol
           Product: Apache httpd-2
           Version: 2.2.32
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: minor
          Priority: P2
         Component: Core
          Assignee: bugs@httpd.apache.org
          Reporter: paolo@adnovum.ch
  Target Milestone: ---

Hello,

starting apache httpd 2.2 sometimes fails with the following error:

    Invalid ThreadStackSize value: 1048576

The concerned code is here (mpm_common.c):

const char *ap_mpm_set_thread_stacksize(cmd_parms *cmd, void *dummy,

                                        const char *arg)

{

    long value;

    const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);

    if (err != NULL) {

        return err;

    }



    value = strtol(arg, NULL, 0);

    if (value < 0 || errno == ERANGE)

        return apr_pstrcat(cmd->pool, "Invalid ThreadStackSize value: ",

                           arg, NULL);



    ap_thread_stacksize = (apr_size_t)value;



    return NULL;

}

before calling strtol you should init errno to 0, otherwise it will remain
unchanged (if strtol succeeds). If errno has already the value 'ERANGE', the
described error occurs.

Best Regards
Paolo

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 60836] errno not inited before strtol

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60836

--- Comment #1 from paolo@adnovum.ch <pa...@adnovum.ch> ---
I have just seen, that this bug has been fixed in version 2.2.32. So this
ticket can be closed.

Sorry for the confusion.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 60836] errno not inited before strtol

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60836

paolo@adnovum.ch <pa...@adnovum.ch> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #2 from paolo@adnovum.ch <pa...@adnovum.ch> ---
I have just seen, that this bug has been fixed in version 2.2.32. So this
ticket can be closed.

Sorry for the confusion.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 60836] errno not inited before strtol

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60836

paolo@adnovum.ch <pa...@adnovum.ch> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|2.2.32                      |2.2.31

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org