Return-Path: X-Original-To: apmail-httpd-dev-archive@www.apache.org Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id BD85510F50 for ; Sun, 14 Jul 2013 01:45:03 +0000 (UTC) Received: (qmail 78094 invoked by uid 500); 14 Jul 2013 01:45:03 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 78044 invoked by uid 500); 14 Jul 2013 01:45:03 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 78036 invoked by uid 99); 14 Jul 2013 01:45:03 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 14 Jul 2013 01:45:03 +0000 X-ASF-Spam-Status: No, hits=3.5 required=5.0 tests=FB_GET_MEDS,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of trawick@gmail.com designates 209.85.215.49 as permitted sender) Received: from [209.85.215.49] (HELO mail-la0-f49.google.com) (209.85.215.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 14 Jul 2013 01:44:56 +0000 Received: by mail-la0-f49.google.com with SMTP id ea20so8476790lab.8 for ; Sat, 13 Jul 2013 18:44:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=SFtrGQlE5NPa8iCvqMrv85+LdrrDTpWL2IJVuVoZV7Q=; b=V0dXGucRMatsamnWAJkMi34JCKz/VOsOL7NQ3JL+pT6yBgds+JQPHPq7qIfJ5VMhGG w7B8/1JfVCDGcobjEkvpQSsbxvTGaJlEoevFfBCH6LTFGNcSfD/zS9UEwwFYVSbgfNZ1 9zBel9XWQCuBkfo1/NFEZXPxGWU4ZVBpFecNhE/XRpiefvg1nvzVPiVOnNBRieN9jRfe WaLJjQdRsK5PrdQt/XR/mnqdJEBYukDh9VAf/sPeLW1fdkOjitsSP5pCybRc9W6fnlWN YeTfV2BklhYWGN5FR1BtFMzCigLTPx4P6di2iBmeEfsFIC3AMJITt2Ee4ZorikA+VVMD 8yxg== MIME-Version: 1.0 X-Received: by 10.112.157.137 with SMTP id wm9mr21732529lbb.14.1373766275450; Sat, 13 Jul 2013 18:44:35 -0700 (PDT) Received: by 10.114.175.231 with HTTP; Sat, 13 Jul 2013 18:44:35 -0700 (PDT) In-Reply-To: <20130311163841.2C16E23889CB@eris.apache.org> References: <20130311163841.2C16E23889CB@eris.apache.org> Date: Sat, 13 Jul 2013 21:44:35 -0400 Message-ID: Subject: Re: svn commit: r1455225 - in /httpd/httpd/branches/2.4.x: ./ docs/manual/ docs/manual/howto/ docs/manual/mod/ include/ modules/filters/ modules/generators/ modules/slotmem/ os/unix/ server/ support/ test/ From: Jeff Trawick To: Apache HTTP Server Development List Content-Type: multipart/alternative; boundary=001a11c29654da4d2b04e16ee273 X-Virus-Checked: Checked by ClamAV on apache.org --001a11c29654da4d2b04e16ee273 Content-Type: text/plain; charset=ISO-8859-1 On Mon, Mar 11, 2013 at 12:38 PM, wrote: > Author: jim > Date: Mon Mar 11 16:38:39 2013 > New Revision: 1455225 > > URL: http://svn.apache.org/r1455225 > Log: > Merge r1442865, r1442759, r1442326, r1442309, r1448171, r1418556, > r1448453, r1425771, r1425772, r1425775 from trunk: > > Change bzero/bcopy into memset/memcpy > > PR 54346 > > Can't figure out why we allocate len+2 bytes here. Len+1 should be enough. > > Fix valgrind warning about uninitialized memory in argument to semctl > > PR: 53690 > Submitted by: Mikhail T. > > > fix valgrind warnings about uninitialized memory in syscall arguments > > > This is useful info for mod_status ;) > > Add some __attribute__ for automatic format checking. > Correct one catch in sed0.c. > > Correct some spelling. > > > Replace strdup by ap_malloc to ensure a proper error message if > out-of-memory. > While there, only allocate memory for the string part we actually use. > > PR: 54345 > > > Exit with error message if out of mem > > > htdbm, htpasswd: print error message if out of memory > > PR: 54345 > > Submitted by: jailletc36, sf, sf, jim, jailletc36, minfrin, sf, sf, sf > Reviewed/backported by: jim > > Modified: > httpd/httpd/branches/2.4.x/ (props changed) > httpd/httpd/branches/2.4.x/STATUS > httpd/httpd/branches/2.4.x/docs/manual/ (props changed) > httpd/httpd/branches/2.4.x/docs/manual/howto/ (props changed) > httpd/httpd/branches/2.4.x/docs/manual/mod/ (props changed) > httpd/httpd/branches/2.4.x/include/httpd.h > httpd/httpd/branches/2.4.x/include/util_filter.h > httpd/httpd/branches/2.4.x/modules/filters/regexp.h > httpd/httpd/branches/2.4.x/modules/filters/sed0.c > httpd/httpd/branches/2.4.x/modules/generators/mod_status.c > httpd/httpd/branches/2.4.x/modules/slotmem/mod_slotmem_shm.c > httpd/httpd/branches/2.4.x/os/unix/unixd.c > httpd/httpd/branches/2.4.x/server/config.c > httpd/httpd/branches/2.4.x/server/util.c > httpd/httpd/branches/2.4.x/support/htdbm.c > httpd/httpd/branches/2.4.x/support/htpasswd.c > httpd/httpd/branches/2.4.x/support/passwd_common.c > httpd/httpd/branches/2.4.x/support/passwd_common.h > httpd/httpd/branches/2.4.x/support/suexec.c > httpd/httpd/branches/2.4.x/test/test_limits.c > > Propchange: httpd/httpd/branches/2.4.x/ > > ------------------------------------------------------------------------------ > Merged > /httpd/httpd/trunk:r1418556,1425771-1425772,1425775,1442309,1442326,1442759,1442865,1448171,1448453 > > Modified: httpd/httpd/branches/2.4.x/STATUS > URL: > http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/STATUS?rev=1455225&r1=1455224&r2=1455225&view=diff > > ============================================================================== > --- httpd/httpd/branches/2.4.x/STATUS (original) > +++ httpd/httpd/branches/2.4.x/STATUS Mon Mar 11 16:38:39 2013 > @@ -90,39 +90,11 @@ RELEASE SHOWSTOPPERS: > PATCHES ACCEPTED TO BACKPORT FROM TRUNK: > [ start all new proposals below, under PATCHES PROPOSED. ] > > - > - * Set of easy patches to keep 2.4.x in line with trunk > - 1442865: Change bzero/bcopy into memset/memcpy (PR 54346) > - 1442759: Can't figure out why we allocate len+2 bytes here. Len+1 > should be enough. > - 1442326: Fix valgrind warning about uninitialized memory in > argument to semctl (PR 53690) > - 1442309: fix valgrind warnings about uninitialized memory in > syscall arguments > - 1448171: This is useful info for mod_status ;) > - 1418556: Add some __attribute__ for automatic format checking. > - 1448453: Correct some spelling. > - 1425771: Replace strdup by ap_malloc to ensure a proper error > message if out-of-memory. (PR 54345) > - 1425772: Exit with error message if out of mem (PR 54345) > - 1425775: htdbm, htpasswd: print error message if out of memory (PR > 54345) > - trunk patches: > - http://svn.apache.org/viewvc?view=revision&revision=1442865 > - http://svn.apache.org/viewvc?view=revision&revision=1442759 > - http://svn.apache.org/viewvc?view=revision&revision=1442326 > - http://svn.apache.org/viewvc?view=revision&revision=1442309 > - http://svn.apache.org/viewvc?view=revision&revision=1448171 > - http://svn.apache.org/viewvc?view=revision&revision=1418556 > - http://svn.apache.org/viewvc?view=revision&revision=1448453 > - http://svn.apache.org/viewvc?view=revision&revision=1425771 > - http://svn.apache.org/viewvc?view=revision&revision=1425772 > - http://svn.apache.org/viewvc?view=revision&revision=1425775 > - 2.4.x patch: trunk patches apply (minus CHANGES for 1448171) > - 2.4.x cumulative patch: > http://people.apache.org/~jailletc36/backport5.patch (minus CHANGES for > 1448171) > - +1: jailletc36, igalic, jim > - > * mod_cache_disk: fix merge of min/max file size by setting > corresponding _set > trunk patch: http://svn.apache.org/r1453604 > 2.4.x patch: trunk patch works > +1: humbedooh, jim, covener > > - > PATCHES PROPOSED TO BACKPORT FROM TRUNK: > [ New proposals should be added at the end of the list ] > > > Propchange: httpd/httpd/branches/2.4.x/docs/manual/ > > ------------------------------------------------------------------------------ > Merged > /httpd/httpd/trunk/docs/manual:r1418556,1425771-1425772,1425775,1442309,1442326,1442759,1442865,1448171,1448453 > > Propchange: httpd/httpd/branches/2.4.x/docs/manual/howto/ > > ------------------------------------------------------------------------------ > Merged > /httpd/httpd/trunk/docs/manual/howto:r1418556,1425771-1425772,1425775,1442309,1442326,1442759,1442865,1448171,1448453 > > Propchange: httpd/httpd/branches/2.4.x/docs/manual/mod/ > > ------------------------------------------------------------------------------ > Merged > /httpd/httpd/trunk/docs/manual/mod:r1418556,1425771-1425772,1425775,1442309,1442326,1442759,1442865,1448171,1448453 > > Modified: httpd/httpd/branches/2.4.x/include/httpd.h > URL: > http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/include/httpd.h?rev=1455225&r1=1455224&r2=1455225&view=diff > > ============================================================================== > --- httpd/httpd/branches/2.4.x/include/httpd.h (original) > +++ httpd/httpd/branches/2.4.x/include/httpd.h Mon Mar 11 16:38:39 2013 > @@ -1388,7 +1388,7 @@ AP_DECLARE(char *) ap_ht_time(apr_pool_t > char **) */ > > /** > - * Get the characters until the first occurance of a specified character > + * Get the characters until the first occurrence of a specified character > * @param p The pool to allocate memory from > * @param line The string to get the characters from > * @param stop The character to stop at > @@ -1397,7 +1397,7 @@ AP_DECLARE(char *) ap_ht_time(apr_pool_t > AP_DECLARE(char *) ap_getword(apr_pool_t *p, const char **line, char > stop); > > /** > - * Get the characters until the first occurance of a specified character > + * Get the characters until the first occurrence of a specified character > * @param p The pool to allocate memory from > * @param line The string to get the characters from > * @param stop The character to stop at > @@ -1426,22 +1426,22 @@ AP_DECLARE(char *) ap_getword_white(apr_ > AP_DECLARE(char *) ap_getword_white_nc(apr_pool_t *p, char **line); > > /** > - * Get all characters from the first occurance of @a stop to the first > "\0" > + * Get all characters from the first occurrence of @a stop to the first > "\0" > * @param p The pool to allocate memory from > * @param line The line to traverse > * @param stop The character to start at > - * @return A copy of all caracters after the first occurance of the > specified > + * @return A copy of all characters after the first occurrence of the > specified > * character > */ > AP_DECLARE(char *) ap_getword_nulls(apr_pool_t *p, const char **line, > char stop); > > /** > - * Get all characters from the first occurance of @a stop to the first > "\0" > + * Get all characters from the first occurrence of @a stop to the first > "\0" > * @param p The pool to allocate memory from > * @param line The line to traverse > * @param stop The character to start at > - * @return A copy of all caracters after the first occurance of the > specified > + * @return A copy of all characters after the first occurrence of the > specified > * character > * @note The same as ap_getword_nulls(), except it doesn't use const char > **. > */ > > Modified: httpd/httpd/branches/2.4.x/include/util_filter.h > URL: > http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/include/util_filter.h?rev=1455225&r1=1455224&r2=1455225&view=diff > > ============================================================================== > --- httpd/httpd/branches/2.4.x/include/util_filter.h (original) > +++ httpd/httpd/branches/2.4.x/include/util_filter.h Mon Mar 11 16:38:39 > 2013 > @@ -332,8 +332,8 @@ AP_DECLARE(apr_status_t) ap_pass_brigade > AP_DECLARE(apr_status_t) ap_pass_brigade_fchk(request_rec *r, > apr_bucket_brigade *bucket, > const char *fmt, > - ...); > - > + ...) > + > __attribute__((format(printf,3,4))); > ap_pass_brigade_fchk() has a defined meaning for passing NULL for the format string, and mod_negotiation uses that feature. But in combination with the printf check we get this new warning with 2.4.5: $ cat stderr mod_negotiation.c: In function 'handle_map_file': mod_negotiation.c:3053: warning: null format string I guess that with fmt=NULL being a good value this attribute isn't exactly correct. I haven't checked if there is a better alternative that provides the necessary checking. Extending the API to treat "" like NULL certainly doesn't help. Maybe a _DEFAULT_ fmt would be required. > > /** > * This function is used to register an input filter with the system. > > Modified: httpd/httpd/branches/2.4.x/modules/filters/regexp.h > URL: > http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/filters/regexp.h?rev=1455225&r1=1455224&r2=1455225&view=diff > > ============================================================================== > --- httpd/httpd/branches/2.4.x/modules/filters/regexp.h (original) > +++ httpd/httpd/branches/2.4.x/modules/filters/regexp.h Mon Mar 11 > 16:38:39 2013 > @@ -69,7 +69,8 @@ typedef struct _sed_comp_args { > > extern char *sed_compile(sed_commands_t *commands, sed_comp_args > *compargs, > char *ep, char *endbuf, int seof); > -extern void command_errf(sed_commands_t *commands, const char *fmt, ...); > +extern void command_errf(sed_commands_t *commands, const char *fmt, ...) > + __attribute__((format(printf,2,3))); > > #define SEDERR_CGMES "command garbled: %s" > #define SEDERR_SMMES "Space missing before filename: %s" > > Modified: httpd/httpd/branches/2.4.x/modules/filters/sed0.c > URL: > http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/filters/sed0.c?rev=1455225&r1=1455224&r2=1455225&view=diff > > ============================================================================== > --- httpd/httpd/branches/2.4.x/modules/filters/sed0.c (original) > +++ httpd/httpd/branches/2.4.x/modules/filters/sed0.c Mon Mar 11 16:38:39 > 2013 > @@ -275,7 +275,7 @@ comploop: > } > > if(p > &commands->respace[RESIZE-1]) { > - command_errf(commands, SEDERR_TMMES); > + command_errf(commands, SEDERR_TMMES, commands->linebuf); > return -1; > } > > > Modified: httpd/httpd/branches/2.4.x/modules/generators/mod_status.c > URL: > http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/generators/mod_status.c?rev=1455225&r1=1455224&r2=1455225&view=diff > > ============================================================================== > --- httpd/httpd/branches/2.4.x/modules/generators/mod_status.c (original) > +++ httpd/httpd/branches/2.4.x/modules/generators/mod_status.c Mon Mar 11 > 16:38:39 2013 > @@ -405,6 +405,8 @@ static int status_handler(request_rec *r > ")\n\n", NULL); > ap_rvputs(r, "
Server Version: ", > ap_get_server_description(), "
\n", NULL); > + ap_rvputs(r, "
Server MPM: ", > + ap_show_mpm(), "
\n", NULL); > ap_rvputs(r, "
Server Built: ", > ap_get_server_built(), "\n

\n", > NULL); > ap_rvputs(r, "
Current Time: ", > @@ -953,4 +955,3 @@ AP_DECLARE_MODULE(status) = > NULL, /* command table */ > register_hooks /* register_hooks */ > }; > - > > Modified: httpd/httpd/branches/2.4.x/modules/slotmem/mod_slotmem_shm.c > URL: > http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/slotmem/mod_slotmem_shm.c?rev=1455225&r1=1455224&r2=1455225&view=diff > > ============================================================================== > --- httpd/httpd/branches/2.4.x/modules/slotmem/mod_slotmem_shm.c (original) > +++ httpd/httpd/branches/2.4.x/modules/slotmem/mod_slotmem_shm.c Mon Mar > 11 16:38:39 2013 > @@ -91,7 +91,7 @@ static apr_status_t unixd_set_shm_perms( > { > #ifdef AP_NEED_SET_MUTEX_PERMS > #if APR_USE_SHMEM_SHMGET || APR_USE_SHMEM_SHMGET_ANON > - struct shmid_ds shmbuf; > + struct shmid_ds shmbuf = { { 0 } }; > key_t shmkey; > int shmid; > > > Modified: httpd/httpd/branches/2.4.x/os/unix/unixd.c > URL: > http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/os/unix/unixd.c?rev=1455225&r1=1455224&r2=1455225&view=diff > > ============================================================================== > --- httpd/httpd/branches/2.4.x/os/unix/unixd.c (original) > +++ httpd/httpd/branches/2.4.x/os/unix/unixd.c Mon Mar 11 16:38:39 2013 > @@ -241,7 +241,7 @@ AP_DECLARE(apr_status_t) ap_unixd_set_pr > }; > #endif > union semun ick; > - struct semid_ds buf; > + struct semid_ds buf = { { 0 } }; > > apr_os_proc_mutex_get(&ospmutex, pmutex); > buf.sem_perm.uid = ap_unixd_config.user_id; > > Modified: httpd/httpd/branches/2.4.x/server/config.c > URL: > http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/server/config.c?rev=1455225&r1=1455224&r2=1455225&view=diff > > ============================================================================== > --- httpd/httpd/branches/2.4.x/server/config.c (original) > +++ httpd/httpd/branches/2.4.x/server/config.c Mon Mar 11 16:38:39 2013 > @@ -599,7 +599,8 @@ AP_DECLARE(const char *) ap_add_module(m > len -= slen; > } > > - ap_module_short_names[m->module_index] = strdup(sym_name); > + ap_module_short_names[m->module_index] = ap_malloc(len + 1); > + memcpy(ap_module_short_names[m->module_index], sym_name, len); > ap_module_short_names[m->module_index][len] = '\0'; > merger_func_cache[m->module_index] = m->merge_dir_config; > } > @@ -623,8 +624,9 @@ AP_DECLARE(const char *) ap_add_module(m > > /* We cannot fix the string in-place, because it's const */ > if (m->name[strlen(m->name)-1] == ')') { > - char *tmp = strdup(m->name); /* FIXME: memory leak, albeit a > small one */ > - tmp[strlen(tmp)-1] = '\0'; > + char *tmp = ap_malloc(strlen(m->name)); /* FIXME: memory leak, > albeit a small one */ > + memcpy(tmp, m->name, strlen(m->name)-1); > + tmp[strlen(m->name)-1] = '\0'; > m->name = tmp; > } > #endif /*_OSD_POSIX*/ > > Modified: httpd/httpd/branches/2.4.x/server/util.c > URL: > http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/server/util.c?rev=1455225&r1=1455224&r2=1455225&view=diff > > ============================================================================== > --- httpd/httpd/branches/2.4.x/server/util.c (original) > +++ httpd/httpd/branches/2.4.x/server/util.c Mon Mar 11 16:38:39 2013 > @@ -752,7 +752,7 @@ AP_DECLARE(char *) ap_getword_nulls(apr_ > static char *substring_conf(apr_pool_t *p, const char *start, int len, > char quote) > { > - char *result = apr_palloc(p, len + 2); > + char *result = apr_palloc(p, len + 1); > char *resp = result; > int i; > > > Modified: httpd/httpd/branches/2.4.x/support/htdbm.c > URL: > http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/support/htdbm.c?rev=1455225&r1=1455224&r2=1455225&view=diff > > ============================================================================== > --- httpd/httpd/branches/2.4.x/support/htdbm.c (original) > +++ httpd/httpd/branches/2.4.x/support/htdbm.c Mon Mar 11 16:38:39 2013 > @@ -110,6 +110,7 @@ static apr_status_t htdbm_init(apr_pool_ > #endif > > apr_pool_create( pool, NULL); > + apr_pool_abort_set(abort_on_oom, *pool); > apr_file_open_stderr(&errfile, *pool); > apr_signal(SIGINT, (void (*)(int)) htdbm_interrupted); > > > Modified: httpd/httpd/branches/2.4.x/support/htpasswd.c > URL: > http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/support/htpasswd.c?rev=1455225&r1=1455224&r2=1455225&view=diff > > ============================================================================== > --- httpd/httpd/branches/2.4.x/support/htpasswd.c (original) > +++ httpd/httpd/branches/2.4.x/support/htpasswd.c Mon Mar 11 16:38:39 2013 > @@ -274,6 +274,7 @@ int main(int argc, const char * const ar > apr_app_initialize(&argc, &argv, NULL); > atexit(terminate); > apr_pool_create(&pool, NULL); > + apr_pool_abort_set(abort_on_oom, pool); > apr_file_open_stderr(&errfile, pool); > ctx.pool = pool; > ctx.alg = ALG_APMD5; > > Modified: httpd/httpd/branches/2.4.x/support/passwd_common.c > URL: > http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/support/passwd_common.c?rev=1455225&r1=1455224&r2=1455225&view=diff > > ============================================================================== > --- httpd/httpd/branches/2.4.x/support/passwd_common.c (original) > +++ httpd/httpd/branches/2.4.x/support/passwd_common.c Mon Mar 11 16:38:39 > 2013 > @@ -46,6 +46,24 @@ > > apr_file_t *errfile; > > +int abort_on_oom(int rc) > +{ > + const char *buf = "Error: out of memory\n"; > + int written, count = strlen(buf); > + do { > + written = write(STDERR_FILENO, buf, count); > + if (written == count) > + break; > + if (written > 0) { > + buf += written; > + count -= written; > + } > + } while (written >= 0 || errno == EINTR); > + abort(); > + /* NOTREACHED */ > + return 0; > +} > + > static int generate_salt(char *s, size_t size, const char **errstr, > apr_pool_t *pool) > { > @@ -207,6 +225,8 @@ int mkhash(struct passwd_ctx *ctx) > apr_cpystrn(ctx->out, cbuf, ctx->out_len - 1); > if (strlen(pw) > 8) { > char *truncpw = strdup(pw); > + if (truncpw == NULL) > + abort_on_oom(0); > truncpw[8] = '\0'; > if (!strcmp(ctx->out, crypt(truncpw, salt))) { > apr_file_printf(errfile, "Warning: Password truncated to > 8 " > > Modified: httpd/httpd/branches/2.4.x/support/passwd_common.h > URL: > http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/support/passwd_common.h?rev=1455225&r1=1455224&r2=1455225&view=diff > > ============================================================================== > --- httpd/httpd/branches/2.4.x/support/passwd_common.h (original) > +++ httpd/httpd/branches/2.4.x/support/passwd_common.h Mon Mar 11 16:38:39 > 2013 > @@ -84,6 +84,12 @@ struct passwd_ctx { > } passwd_src; > }; > > + > +/* > + * To be used as apr_pool_abort_fn > + */ > +int abort_on_oom(int rc); > + > /* > * Write a line to the file. On error, print a message and exit > */ > > Modified: httpd/httpd/branches/2.4.x/support/suexec.c > URL: > http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/support/suexec.c?rev=1455225&r1=1455224&r2=1455225&view=diff > > ============================================================================== > --- httpd/httpd/branches/2.4.x/support/suexec.c (original) > +++ httpd/httpd/branches/2.4.x/support/suexec.c Mon Mar 11 16:38:39 2013 > @@ -217,11 +217,15 @@ static void clean_env(void) > > if ((cleanenv = (char **) calloc(AP_ENVBUF, sizeof(char *))) == NULL) > { > log_err("failed to malloc memory for environment\n"); > - exit(120); > + exit(123); > } > > sprintf(pathbuf, "PATH=%s", AP_SAFE_PATH); > cleanenv[cidx] = strdup(pathbuf); > + if (cleanenv[cidx] == NULL) { > + log_err("failed to malloc memory for environment\n"); > + exit(124); > + } > cidx++; > > for (ep = envp; *ep && cidx < AP_ENVBUF-1; ep++) { > @@ -396,7 +400,10 @@ int main(int argc, char *argv[]) > } > } > gid = gr->gr_gid; > - actual_gname = strdup(gr->gr_name); > + if ((actual_gname = strdup(gr->gr_name)) == NULL) { > + log_err("failed to alloc memory\n"); > + exit(125); > + } > > #ifdef _OSD_POSIX > /* > @@ -431,6 +438,10 @@ int main(int argc, char *argv[]) > uid = pw->pw_uid; > actual_uname = strdup(pw->pw_name); > target_homedir = strdup(pw->pw_dir); > + if (actual_uname == NULL || target_homedir == NULL) { > + log_err("failed to alloc memory\n"); > + exit(126); > + } > > /* > * Log the transaction here to be sure we have an open log > > Modified: httpd/httpd/branches/2.4.x/test/test_limits.c > URL: > http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/test/test_limits.c?rev=1455225&r1=1455224&r2=1455225&view=diff > > ============================================================================== > --- httpd/httpd/branches/2.4.x/test/test_limits.c (original) > +++ httpd/httpd/branches/2.4.x/test/test_limits.c Mon Mar 11 16:38:39 2013 > @@ -124,8 +124,8 @@ main(int argc, char *argv[]) > perror("gethostbyname"); > exit(1); > } > - bzero(&sin, sizeof(sin)); > - bcopy(he->h_addr, (char *)&sin.sin_addr, he->h_length); > + memset(&sin, sizeof(sin)); > + memcpy((char *)&sin.sin_addr, he->h_addr, he->h_length); > sin.sin_family = he->h_addrtype; > sin.sin_port = htons(port); > > > > -- Born in Roswell... married an alien... http://emptyhammock.com/ --001a11c29654da4d2b04e16ee273 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
On Mon, Mar 11, 2013 at 12:38 PM, <<= a href=3D"mailto:jim@apache.org" target=3D"_blank">jim@apache.org> wrote:
Author: jim
Date: Mon Mar 11 16:38:39 2013
New Revision: 1455225

URL: http://sv= n.apache.org/r1455225
Log:
Merge r1442865, r1442759, r1442326, r1442309, r1448171, r1418556, r1448453,= r1425771, r1425772, r1425775 from trunk:

Change bzero/bcopy into memset/memcpy

PR 54346

Can't figure out why we allocate len+2 bytes here. Len+1 should be enou= gh.

Fix valgrind warning about uninitialized memory in argument to semctl

PR: 53690
Submitted by: Mikhail T. <mi+apache aldan algebra com>


fix valgrind warnings about uninitialized memory in syscall arguments


This is useful info for mod_status ;)

Add some __attribute__ for automatic format checking.
Correct one catch in sed0.c.

Correct some spelling.


Replace strdup by ap_malloc to ensure a proper error message if out-of-memo= ry.
While there, only allocate memory for the string part we actually use.

PR: 54345


Exit with error message if out of mem


htdbm, htpasswd: print error message if out of memory

PR: 54345

Submitted by: jailletc36, sf, sf, jim, jailletc36, minfrin, sf, sf, sf
Reviewed/backported by: jim

Modified:
=A0 =A0 httpd/httpd/branches/2.4.x/ =A0 (props changed)
=A0 =A0 httpd/httpd/branches/2.4.x/STATUS
=A0 =A0 httpd/httpd/branches/2.4.x/docs/manual/ =A0 (props changed)
=A0 =A0 httpd/httpd/branches/2.4.x/docs/manual/howto/ =A0 (props changed) =A0 =A0 httpd/httpd/branches/2.4.x/docs/manual/mod/ =A0 (props changed)
=A0 =A0 httpd/httpd/branches/2.4.x/include/httpd.h
=A0 =A0 httpd/httpd/branches/2.4.x/include/util_filter.h
=A0 =A0 httpd/httpd/branches/2.4.x/modules/filters/regexp.h
=A0 =A0 httpd/httpd/branches/2.4.x/modules/filters/sed0.c
=A0 =A0 httpd/httpd/branches/2.4.x/modules/generators/mod_status.c
=A0 =A0 httpd/httpd/branches/2.4.x/modules/slotmem/mod_slotmem_shm.c
=A0 =A0 httpd/httpd/branches/2.4.x/os/unix/unixd.c
=A0 =A0 httpd/httpd/branches/2.4.x/server/config.c
=A0 =A0 httpd/httpd/branches/2.4.x/server/util.c
=A0 =A0 httpd/httpd/branches/2.4.x/support/htdbm.c
=A0 =A0 httpd/httpd/branches/2.4.x/support/htpasswd.c
=A0 =A0 httpd/httpd/branches/2.4.x/support/passwd_common.c
=A0 =A0 httpd/httpd/branches/2.4.x/support/passwd_common.h
=A0 =A0 httpd/httpd/branches/2.4.x/support/suexec.c
=A0 =A0 httpd/httpd/branches/2.4.x/test/test_limits.c

Propchange: httpd/httpd/branches/2.4.x/
---------------------------------------------------------------------------= ---
=A0 Merged /httpd/httpd/trunk:r1418556,1425771-1425772,1425775,1442309,1442= 326,1442759,1442865,1448171,1448453

Modified: httpd/httpd/branches/2.4.x/STATUS
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/STATUS?= rev=3D1455225&r1=3D1455224&r2=3D1455225&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D
--- httpd/httpd/branches/2.4.x/STATUS (original)
+++ httpd/httpd/branches/2.4.x/STATUS Mon Mar 11 16:38:39 2013
@@ -90,39 +90,11 @@ RELEASE SHOWSTOPPERS:
=A0PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
=A0 =A0[ start all new proposals below, under PATCHES PROPOSED. ]

-
- =A0* Set of easy patches to keep 2.4.x in line with trunk
- =A0 =A0 =A0 1442865: Change bzero/bcopy into memset/memcpy (PR 54346)
- =A0 =A0 =A0 1442759: Can't figure out why we allocate len+2 bytes her= e. Len+1 should be enough.
- =A0 =A0 =A0 1442326: Fix valgrind warning about uninitialized memory in a= rgument to semctl (PR 53690)
- =A0 =A0 =A0 1442309: fix valgrind warnings about uninitialized memory in = syscall arguments
- =A0 =A0 =A0 1448171: This is useful info for mod_status ;)
- =A0 =A0 =A0 1418556: Add some __attribute__ for automatic format checking= .
- =A0 =A0 =A0 1448453: Correct some spelling.
- =A0 =A0 =A0 1425771: Replace strdup by ap_malloc to ensure a proper error= message if out-of-memory. (PR 54345)
- =A0 =A0 =A0 1425772: Exit with error message if out of mem (PR 54345)
- =A0 =A0 =A0 1425775: htdbm, htpasswd: print error message if out of memor= y (PR 54345)
- =A0 =A0trunk patches:
- =A0 =A0 =A0 http://svn.apache.org/viewvc?view=3Dre= vision&revision=3D1442865
- =A0 =A0 =A0 http://svn.apache.org/viewvc?view=3Dre= vision&revision=3D1442759
- =A0 =A0 =A0 http://svn.apache.org/viewvc?view=3Dre= vision&revision=3D1442326
- =A0 =A0 =A0 http://svn.apache.org/viewvc?view=3Dre= vision&revision=3D1442309
- =A0 =A0 =A0 http://svn.apache.org/viewvc?view=3Dre= vision&revision=3D1448171
- =A0 =A0 =A0 http://svn.apache.org/viewvc?view=3Dre= vision&revision=3D1418556
- =A0 =A0 =A0 http://svn.apache.org/viewvc?view=3Dre= vision&revision=3D1448453
- =A0 =A0 =A0 http://svn.apache.org/viewvc?view=3Dre= vision&revision=3D1425771
- =A0 =A0 =A0 http://svn.apache.org/viewvc?view=3Dre= vision&revision=3D1425772
- =A0 =A0 =A0 http://svn.apache.org/viewvc?view=3Dre= vision&revision=3D1425775
- =A0 =A02.4.x patch: trunk patches apply (minus CHANGES for 1448171)
- =A0 =A02.4.x cumulative patch: http://people.apache.org/~jailletc= 36/backport5.patch (minus CHANGES for 1448171)
- =A0 =A0+1: jailletc36, igalic, jim
-
=A0 =A0* mod_cache_disk: fix merge of min/max file size by setting correspo= nding _set
=A0 =A0 =A0trunk patch: http://svn.apache.org/r1453604
=A0 =A0 =A02.4.x patch: trunk patch works
=A0 =A0 =A0+1: humbedooh, jim, covener

-
=A0PATCHES PROPOSED TO BACKPORT FROM TRUNK:
=A0 =A0[ New proposals should be added at the end of the list ]


Propchange: httpd/httpd/branches/2.4.x/docs/manual/
---------------------------------------------------------------------------= ---
=A0 Merged /httpd/httpd/trunk/docs/manual:r1418556,1425771-1425772,1425775,= 1442309,1442326,1442759,1442865,1448171,1448453

Propchange: httpd/httpd/branches/2.4.x/docs/manual/howto/
---------------------------------------------------------------------------= ---
=A0 Merged /httpd/httpd/trunk/docs/manual/howto:r1418556,1425771-1425772,14= 25775,1442309,1442326,1442759,1442865,1448171,1448453

Propchange: httpd/httpd/branches/2.4.x/docs/manual/mod/
---------------------------------------------------------------------------= ---
=A0 Merged /httpd/httpd/trunk/docs/manual/mod:r1418556,1425771-1425772,1425= 775,1442309,1442326,1442759,1442865,1448171,1448453

Modified: httpd/httpd/branches/2.4.x/include/httpd.h
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.= x/include/httpd.h?rev=3D1455225&r1=3D1455224&r2=3D1455225&view= =3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D
--- httpd/httpd/branches/2.4.x/include/httpd.h (original)
+++ httpd/httpd/branches/2.4.x/include/httpd.h Mon Mar 11 16:38:39 2013
@@ -1388,7 +1388,7 @@ AP_DECLARE(char *) ap_ht_time(apr_pool_t
=A0 =A0 char **) */

=A0/**
- * Get the characters until the first occurance of a specified character + * Get the characters until the first occurrence of a specified character<= br> =A0 * @param p The pool to allocate memory from
=A0 * @param line The string to get the characters from
=A0 * @param stop The character to stop at
@@ -1397,7 +1397,7 @@ AP_DECLARE(char *) ap_ht_time(apr_pool_t
=A0AP_DECLARE(char *) ap_getword(apr_pool_t *p, const char **line, char sto= p);

=A0/**
- * Get the characters until the first occurance of a specified character + * Get the characters until the first occurrence of a specified character<= br> =A0 * @param p The pool to allocate memory from
=A0 * @param line The string to get the characters from
=A0 * @param stop The character to stop at
@@ -1426,22 +1426,22 @@ AP_DECLARE(char *) ap_getword_white(apr_
=A0AP_DECLARE(char *) ap_getword_white_nc(apr_pool_t *p, char **line);

=A0/**
- * Get all characters from the first occurance of @a stop to the first &qu= ot;\0"
+ * Get all characters from the first occurrence of @a stop to the first &q= uot;\0"
=A0 * @param p The pool to allocate memory from
=A0 * @param line The line to traverse
=A0 * @param stop The character to start at
- * @return A copy of all caracters after the first occurance of the specif= ied
+ * @return A copy of all characters after the first occurrence of the spec= ified
=A0 * =A0 =A0 =A0 =A0 character
=A0 */
=A0AP_DECLARE(char *) ap_getword_nulls(apr_pool_t *p, const char **line, =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= char stop);

=A0/**
- * Get all characters from the first occurance of @a stop to the first &qu= ot;\0"
+ * Get all characters from the first occurrence of @a stop to the first &q= uot;\0"
=A0 * @param p The pool to allocate memory from
=A0 * @param line The line to traverse
=A0 * @param stop The character to start at
- * @return A copy of all caracters after the first occurance of the specif= ied
+ * @return A copy of all characters after the first occurrence of the spec= ified
=A0 * =A0 =A0 =A0 =A0 character
=A0 * @note The same as ap_getword_nulls(), except it doesn't use const= char **.
=A0 */

Modified: httpd/httpd/branches/2.4.x/include/util_filter.h
URL: http://svn.apache.org/viewvc/httpd/httpd/branche= s/2.4.x/include/util_filter.h?rev=3D1455225&r1=3D1455224&r2=3D14552= 25&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D
--- httpd/httpd/branches/2.4.x/include/util_filter.h (original)
+++ httpd/httpd/branches/2.4.x/include/util_filter.h Mon Mar 11 16:38:39 20= 13
@@ -332,8 +332,8 @@ AP_DECLARE(apr_status_t) ap_pass_brigade
=A0AP_DECLARE(apr_status_t) ap_pass_brigade_fchk(request_rec *r,
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0apr_bucket_brigade *bucket,
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0const char *fmt,
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0...);
-
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0...)
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0__attribute__((format(printf,3,4)));

ap_pass_brigade_fchk() has a defined meaning for passing N= ULL for the format string, and mod_negotiation uses that feature. =A0But in= combination with the printf check we get this new warning with 2.4.5:

$ cat stderr=A0
mod_negotiation.c: In fu= nction 'handle_map_file':
mod_negotiation.c:3053: warning= : null format string

I guess that with fmt= =3DNULL being a good value this attribute isn't exactly correct. =A0I h= aven't checked if there is a better alternative that provides the neces= sary checking. =A0Extending the API to treat "" like NULL certain= ly doesn't help. =A0Maybe a _DEFAULT_ fmt would be required.

=A0

=A0/**
=A0 * This function is used to register an input filter with the system.
Modified: httpd/httpd/branches/2.4.x/modules/filters/regexp.h
URL: http://svn.apache.org/viewvc/httpd/httpd/bran= ches/2.4.x/modules/filters/regexp.h?rev=3D1455225&r1=3D1455224&r2= =3D1455225&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D
--- httpd/httpd/branches/2.4.x/modules/filters/regexp.h (original)
+++ httpd/httpd/branches/2.4.x/modules/filters/regexp.h Mon Mar 11 16:38:39= 2013
@@ -69,7 +69,8 @@ typedef struct _sed_comp_args {

=A0extern char *sed_compile(sed_commands_t *commands, sed_comp_args *compar= gs,
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 char *ep, char *endbuf,= int seof);
-extern void command_errf(sed_commands_t *commands, const char *fmt, ...);<= br> +extern void command_errf(sed_commands_t *commands, const char *fmt, ...) + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 __attribute__((format(pri= ntf,2,3)));

=A0#define SEDERR_CGMES "command garbled: %s"
=A0#define SEDERR_SMMES "Space missing before filename: %s"

Modified: httpd/httpd/branches/2.4.x/modules/filters/sed0.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branch= es/2.4.x/modules/filters/sed0.c?rev=3D1455225&r1=3D1455224&r2=3D145= 5225&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D
--- httpd/httpd/branches/2.4.x/modules/filters/sed0.c (original)
+++ httpd/httpd/branches/2.4.x/modules/filters/sed0.c Mon Mar 11 16:38:39 2= 013
@@ -275,7 +275,7 @@ comploop:
=A0 =A0 =A0 =A0 =A0}

=A0 =A0 =A0 =A0 =A0if(p > &commands->respace[RESIZE-1]) {
- =A0 =A0 =A0 =A0 =A0 =A0command_errf(commands, SEDERR_TMMES);
+ =A0 =A0 =A0 =A0 =A0 =A0command_errf(commands, SEDERR_TMMES, commands->= linebuf);
=A0 =A0 =A0 =A0 =A0 =A0 =A0return -1;
=A0 =A0 =A0 =A0 =A0}


Modified: httpd/httpd/branches/2.4.x/modules/generators/mod_status.c
URL: http://svn.apache.org/viewvc/httpd/htt= pd/branches/2.4.x/modules/generators/mod_status.c?rev=3D1455225&r1=3D14= 55224&r2=3D1455225&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D
--- httpd/httpd/branches/2.4.x/modules/generators/mod_status.c (original) +++ httpd/httpd/branches/2.4.x/modules/generators/mod_status.c Mon Mar 11 1= 6:38:39 2013
@@ -405,6 +405,8 @@ static int status_handler(request_rec *r
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0")</h1>\n\n", NULL);=
=A0 =A0 =A0 =A0 =A0ap_rvputs(r, "<dl><dt>Server Version: &= quot;,
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0ap_get_server_description(), "&= lt;/dt>\n", NULL);
+ =A0 =A0 =A0 =A0ap_rvputs(r, "<dt>Server MPM: ",
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0ap_show_mpm(), "</dt>\n&quo= t;, NULL);
=A0 =A0 =A0 =A0 =A0ap_rvputs(r, "<dt>Server Built: ",
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0ap_get_server_built(), "\n</= dt></dl><hr /><dl>\n", NULL);
=A0 =A0 =A0 =A0 =A0ap_rvputs(r, "<dt>Current Time: ",
@@ -953,4 +955,3 @@ AP_DECLARE_MODULE(status) =3D
=A0 =A0 =A0NULL, =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* command tab= le */
=A0 =A0 =A0register_hooks =A0 =A0 =A0 =A0 =A0 =A0 =A0/* register_hooks */ =A0};
-

Modified: httpd/httpd/branches/2.4.x/modules/slotmem/mod_slotmem_shm.c
URL: http://svn.apache.org/viewvc/httpd/h= ttpd/branches/2.4.x/modules/slotmem/mod_slotmem_shm.c?rev=3D1455225&r1= =3D1455224&r2=3D1455225&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D
--- httpd/httpd/branches/2.4.x/modules/slotmem/mod_slotmem_shm.c (original)=
+++ httpd/httpd/branches/2.4.x/modules/slotmem/mod_slotmem_shm.c Mon Mar 11= 16:38:39 2013
@@ -91,7 +91,7 @@ static apr_status_t unixd_set_shm_perms(
=A0{
=A0#ifdef AP_NEED_SET_MUTEX_PERMS
=A0#if APR_USE_SHMEM_SHMGET || APR_USE_SHMEM_SHMGET_ANON
- =A0 =A0struct shmid_ds shmbuf;
+ =A0 =A0struct shmid_ds shmbuf =3D { { 0 } };
=A0 =A0 =A0key_t shmkey;
=A0 =A0 =A0int shmid;


Modified: httpd/httpd/branches/2.4.x/os/unix/unixd.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.= x/os/unix/unixd.c?rev=3D1455225&r1=3D1455224&r2=3D1455225&view= =3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D
--- httpd/httpd/branches/2.4.x/os/unix/unixd.c (original)
+++ httpd/httpd/branches/2.4.x/os/unix/unixd.c Mon Mar 11 16:38:39 2013
@@ -241,7 +241,7 @@ AP_DECLARE(apr_status_t) ap_unixd_set_pr
=A0 =A0 =A0 =A0 =A0 =A0 =A0};
=A0#endif
=A0 =A0 =A0 =A0 =A0 =A0 =A0union semun ick;
- =A0 =A0 =A0 =A0 =A0 =A0struct semid_ds buf;
+ =A0 =A0 =A0 =A0 =A0 =A0struct semid_ds buf =3D { { 0 } };

=A0 =A0 =A0 =A0 =A0 =A0 =A0apr_os_proc_mutex_get(&ospmutex, pmutex); =A0 =A0 =A0 =A0 =A0 =A0 =A0buf.sem_perm.uid =3D ap_unixd_config.user_id;
Modified: httpd/httpd/branches/2.4.x/server/config.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.= x/server/config.c?rev=3D1455225&r1=3D1455224&r2=3D1455225&view= =3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D
--- httpd/httpd/branches/2.4.x/server/config.c (original)
+++ httpd/httpd/branches/2.4.x/server/config.c Mon Mar 11 16:38:39 2013
@@ -599,7 +599,8 @@ AP_DECLARE(const char *) ap_add_module(m
=A0 =A0 =A0 =A0 =A0 =A0 =A0len -=3D slen;
=A0 =A0 =A0 =A0 =A0}

- =A0 =A0 =A0 =A0ap_module_short_names[m->module_index] =3D strdup(sym_n= ame);
+ =A0 =A0 =A0 =A0ap_module_short_names[m->module_index] =3D ap_malloc(le= n + 1);
+ =A0 =A0 =A0 =A0memcpy(ap_module_short_names[m->module_index], sym_name= , len);
=A0 =A0 =A0 =A0 =A0ap_module_short_names[m->module_index][len] =3D '= \0';
=A0 =A0 =A0 =A0 =A0merger_func_cache[m->module_index] =3D m->merge_di= r_config;
=A0 =A0 =A0}
@@ -623,8 +624,9 @@ AP_DECLARE(const char *) ap_add_module(m

=A0 =A0 =A0/* We cannot fix the string in-place, because it's const */<= br> =A0 =A0 =A0if (m->name[strlen(m->name)-1] =3D=3D ')') {
- =A0 =A0 =A0 =A0char *tmp =3D strdup(m->name); /* FIXME: memory leak, a= lbeit a small one */
- =A0 =A0 =A0 =A0tmp[strlen(tmp)-1] =3D '\0';
+ =A0 =A0 =A0 =A0char *tmp =3D ap_malloc(strlen(m->name)); /* FIXME: mem= ory leak, albeit a small one */
+ =A0 =A0 =A0 =A0memcpy(tmp, m->name, strlen(m->name)-1);
+ =A0 =A0 =A0 =A0tmp[strlen(m->name)-1] =3D '\0';
=A0 =A0 =A0 =A0 =A0m->name =3D tmp;
=A0 =A0 =A0}
=A0#endif /*_OSD_POSIX*/

Modified: httpd/httpd/branches/2.4.x/server/util.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/= server/util.c?rev=3D1455225&r1=3D1455224&r2=3D1455225&view=3Ddi= ff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D
--- httpd/httpd/branches/2.4.x/server/util.c (original)
+++ httpd/httpd/branches/2.4.x/server/util.c Mon Mar 11 16:38:39 2013
@@ -752,7 +752,7 @@ AP_DECLARE(char *) ap_getword_nulls(apr_
=A0static char *substring_conf(apr_pool_t *p, const char *start, int len, =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0char quote)
=A0{
- =A0 =A0char *result =3D apr_palloc(p, len + 2);
+ =A0 =A0char *result =3D apr_palloc(p, len + 1);
=A0 =A0 =A0char *resp =3D result;
=A0 =A0 =A0int i;


Modified: httpd/httpd/branches/2.4.x/support/htdbm.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.= x/support/htdbm.c?rev=3D1455225&r1=3D1455224&r2=3D1455225&view= =3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D
--- httpd/httpd/branches/2.4.x/support/htdbm.c (original)
+++ httpd/httpd/branches/2.4.x/support/htdbm.c Mon Mar 11 16:38:39 2013
@@ -110,6 +110,7 @@ static apr_status_t htdbm_init(apr_pool_
=A0#endif

=A0 =A0 =A0apr_pool_create( pool, NULL);
+ =A0 =A0apr_pool_abort_set(abort_on_oom, *pool);
=A0 =A0 =A0apr_file_open_stderr(&errfile, *pool);
=A0 =A0 =A0apr_signal(SIGINT, (void (*)(int)) htdbm_interrupted);


Modified: httpd/httpd/branches/2.4.x/support/htpasswd.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2= .4.x/support/htpasswd.c?rev=3D1455225&r1=3D1455224&r2=3D1455225&= ;view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D
--- httpd/httpd/branches/2.4.x/support/htpasswd.c (original)
+++ httpd/httpd/branches/2.4.x/support/htpasswd.c Mon Mar 11 16:38:39 2013<= br> @@ -274,6 +274,7 @@ int main(int argc, const char * const ar
=A0 =A0 =A0apr_app_initialize(&argc, &argv, NULL);
=A0 =A0 =A0atexit(terminate);
=A0 =A0 =A0apr_pool_create(&pool, NULL);
+ =A0 =A0apr_pool_abort_set(abort_on_oom, pool);
=A0 =A0 =A0apr_file_open_stderr(&errfile, pool);
=A0 =A0 =A0ctx.pool =3D pool;
=A0 =A0 =A0ctx.alg =3D ALG_APMD5;

Modified: httpd/httpd/branches/2.4.x/support/passwd_common.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branc= hes/2.4.x/support/passwd_common.c?rev=3D1455225&r1=3D1455224&r2=3D1= 455225&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D
--- httpd/httpd/branches/2.4.x/support/passwd_common.c (original)
+++ httpd/httpd/branches/2.4.x/support/passwd_common.c Mon Mar 11 16:38:39 = 2013
@@ -46,6 +46,24 @@

=A0apr_file_t *errfile;

+int abort_on_oom(int rc)
+{
+ =A0 =A0const char *buf =3D "Error: out of memory\n";
+ =A0 =A0int written, count =3D strlen(buf);
+ =A0 =A0do {
+ =A0 =A0 =A0 =A0written =3D write(STDERR_FILENO, buf, count);
+ =A0 =A0 =A0 =A0if (written =3D=3D count)
+ =A0 =A0 =A0 =A0 =A0 =A0break;
+ =A0 =A0 =A0 =A0if (written > 0) {
+ =A0 =A0 =A0 =A0 =A0 =A0buf +=3D written;
+ =A0 =A0 =A0 =A0 =A0 =A0count -=3D written;
+ =A0 =A0 =A0 =A0}
+ =A0 =A0} while (written >=3D 0 || errno =3D=3D EINTR);
+ =A0 =A0abort();
+ =A0 =A0/* NOTREACHED */
+ =A0 =A0return 0;
+}
+
=A0static int generate_salt(char *s, size_t size, const char **errstr,
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 apr_pool_t *pool)
=A0{
@@ -207,6 +225,8 @@ int mkhash(struct passwd_ctx *ctx)
=A0 =A0 =A0 =A0 =A0apr_cpystrn(ctx->out, cbuf, ctx->out_len - 1);
=A0 =A0 =A0 =A0 =A0if (strlen(pw) > 8) {
=A0 =A0 =A0 =A0 =A0 =A0 =A0char *truncpw =3D strdup(pw);
+ =A0 =A0 =A0 =A0 =A0 =A0if (truncpw =3D=3D NULL)
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0abort_on_oom(0);
=A0 =A0 =A0 =A0 =A0 =A0 =A0truncpw[8] =3D '\0';
=A0 =A0 =A0 =A0 =A0 =A0 =A0if (!strcmp(ctx->out, crypt(truncpw, salt))) = {
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0apr_file_printf(errfile, "Warning: = Password truncated to 8 "

Modified: httpd/httpd/branches/2.4.x/support/passwd_common.h
URL: http://svn.apache.org/viewvc/httpd/httpd/branc= hes/2.4.x/support/passwd_common.h?rev=3D1455225&r1=3D1455224&r2=3D1= 455225&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D
--- httpd/httpd/branches/2.4.x/support/passwd_common.h (original)
+++ httpd/httpd/branches/2.4.x/support/passwd_common.h Mon Mar 11 16:38:39 = 2013
@@ -84,6 +84,12 @@ struct passwd_ctx {
=A0 =A0 =A0} passwd_src;
=A0};

+
+/*
+ * To be used as apr_pool_abort_fn
+ */
+int abort_on_oom(int rc);
+
=A0/*
=A0 * Write a line to the file. On error, print a message and exit
=A0 */

Modified: httpd/httpd/branches/2.4.x/support/suexec.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4= .x/support/suexec.c?rev=3D1455225&r1=3D1455224&r2=3D1455225&vie= w=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D
--- httpd/httpd/branches/2.4.x/support/suexec.c (original)
+++ httpd/httpd/branches/2.4.x/support/suexec.c Mon Mar 11 16:38:39 2013 @@ -217,11 +217,15 @@ static void clean_env(void)

=A0 =A0 =A0if ((cleanenv =3D (char **) calloc(AP_ENVBUF, sizeof(char *))) = =3D=3D NULL) {
=A0 =A0 =A0 =A0 =A0log_err("failed to malloc memory for environment\n&= quot;);
- =A0 =A0 =A0 =A0exit(120);
+ =A0 =A0 =A0 =A0exit(123);
=A0 =A0 =A0}

=A0 =A0 =A0sprintf(pathbuf, "PATH=3D%s", AP_SAFE_PATH);
=A0 =A0 =A0cleanenv[cidx] =3D strdup(pathbuf);
+ =A0 =A0if (cleanenv[cidx] =3D=3D NULL) {
+ =A0 =A0 =A0 =A0log_err("failed to malloc memory for environment\n&qu= ot;);
+ =A0 =A0 =A0 =A0exit(124);
+ =A0 =A0}
=A0 =A0 =A0cidx++;

=A0 =A0 =A0for (ep =3D envp; *ep && cidx < AP_ENVBUF-1; ep++) {<= br> @@ -396,7 +400,10 @@ int main(int argc, char *argv[])
=A0 =A0 =A0 =A0 =A0}
=A0 =A0 =A0}
=A0 =A0 =A0gid =3D gr->gr_gid;
- =A0 =A0actual_gname =3D strdup(gr->gr_name);
+ =A0 =A0if ((actual_gname =3D strdup(gr->gr_name)) =3D=3D NULL) {
+ =A0 =A0 =A0 =A0log_err("failed to alloc memory\n");
+ =A0 =A0 =A0 =A0exit(125);
+ =A0 =A0}

=A0#ifdef _OSD_POSIX
=A0 =A0 =A0/*
@@ -431,6 +438,10 @@ int main(int argc, char *argv[])
=A0 =A0 =A0uid =3D pw->pw_uid;
=A0 =A0 =A0actual_uname =3D strdup(pw->pw_name);
=A0 =A0 =A0target_homedir =3D strdup(pw->pw_dir);
+ =A0 =A0if (actual_uname =3D=3D NULL || target_homedir =3D=3D NULL) {
+ =A0 =A0 =A0 =A0log_err("failed to alloc memory\n");
+ =A0 =A0 =A0 =A0exit(126);
+ =A0 =A0}

=A0 =A0 =A0/*
=A0 =A0 =A0 * Log the transaction here to be sure we have an open log

Modified: httpd/httpd/branches/2.4.x/test/test_limits.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2= .4.x/test/test_limits.c?rev=3D1455225&r1=3D1455224&r2=3D1455225&= ;view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D
--- httpd/httpd/branches/2.4.x/test/test_limits.c (original)
+++ httpd/httpd/branches/2.4.x/test/test_limits.c Mon Mar 11 16:38:39 2013<= br> @@ -124,8 +124,8 @@ main(int argc, char *argv[])
=A0 =A0 =A0 =A0 =A0perror("gethostbyname");
=A0 =A0 =A0 =A0 =A0exit(1);
=A0 =A0 =A0}
- =A0 =A0bzero(&sin, sizeof(sin));
- =A0 =A0bcopy(he->h_addr, (char *)&sin.sin_addr, he->h_length);<= br> + =A0 =A0memset(&sin, sizeof(sin));
+ =A0 =A0memcpy((char *)&sin.sin_addr, he->h_addr, he->h_length);=
=A0 =A0 =A0sin.sin_family =3D he->h_addrtype;
=A0 =A0 =A0sin.sin_port =3D htons(port);






--
Born in Rosw= ell... married an alien...
http://emptyhammock.com/
--001a11c29654da4d2b04e16ee273--