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: [email protected]
          Reporter: [email protected]
  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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to