Potential Bug in mpm_common.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I observed a code clone in the following files. In the function ap_mpm_set_max_mem_free the variable "value" has to be multiplied by 1024 before exit while ap_mpm_set_thread_stacksize does not perform this operation. I wonder if this is necessary. Hope it helps.

function : ap_mpm_set_max_mem_free @ (file: "httpd-2.4.2/server/mpm_common.c", line: 376)~388
    const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
    if (err != NULL) {
        return err;
    }

    value = strtol(arg, NULL, 10);
    if (value < 0 || errno == ERANGE)
        return apr_pstrcat(cmd->pool, "Invalid MaxMemFree value: ",
                           arg, NULL);

    ap_max_mem_free = (apr_uint32_t)value * 1024;

    return NULL;

function : ap_mpm_set_thread_stacksize @ (file: "httpd-2.4.2/server/mpm_common.c", line: 395)~407
    const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
    if (err != NULL) {
        return err;
    }

    value = strtol(arg, NULL, 10);
    if (value < 0 || errno == ERANGE)
        return apr_pstrcat(cmd->pool, "Invalid ThreadStackSize value: ",
                           arg, NULL);

    ap_thread_stacksize = (apr_size_t)value;

    return NULL;

[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux