httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ken Cheung <msrbugzi...@gmail.com>
Subject [users@httpd] Potential Bug in mod_file_cache.c
Date Thu, 14 Jun 2012 06:46:26 GMT
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;
Mime
View raw message