Potential Bug in mod_file_cache.c

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

 



I observed a code clone in the following files. The second and third functions type cast the object after allocation using "apr_palloc" while the first function does not. I wonder if this is necessary in the function "create_server_config". Hope it helps.

function : create_server_config @ (file: "httpd-2.4.2/modules/cache/mod_file_cache.c", line: 119)~122
    a_server_config *sconf = apr_palloc(p, sizeof(*sconf));

    sconf->fileht = apr_hash_make(p);
    return sconf;

function : create_setenvif_config @ (file: "httpd-2.4.2/modules/metadata/mod_setenvif.c", line: 135)~138
    sei_cfg_rec *new = (sei_cfg_rec *) apr_palloc(p, sizeof(sei_cfg_rec));

    new->conditionals = apr_array_make(p, 20, sizeof(sei_entry));
    return (void *) new;

function : lb_hb_create_config @ (file: "httpd-2.4.2/modules/proxy/balancers/mod_lbmethod_heartbeat.c", line: 408)~412
    lb_hb_ctx_t *ctx = (lb_hb_ctx_t *) apr_palloc(p, sizeof(lb_hb_ctx_t));

    ctx->path = ap_server_root_relative(p, "logs/hb.dat");

    return ctx;

[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