Return-Path: X-Original-To: apmail-httpd-cvs-archive@www.apache.org Delivered-To: apmail-httpd-cvs-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 35499100E1 for ; Mon, 10 Jun 2013 17:47:27 +0000 (UTC) Received: (qmail 24984 invoked by uid 500); 10 Jun 2013 17:47:26 -0000 Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 23201 invoked by uid 500); 10 Jun 2013 17:47:21 -0000 Mailing-List: contact cvs-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 cvs@httpd.apache.org Received: (qmail 23174 invoked by uid 99); 10 Jun 2013 17:47:19 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Jun 2013 17:47:19 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Jun 2013 17:47:14 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id B797F23889ED; Mon, 10 Jun 2013 17:46:53 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1491538 - /httpd/httpd/trunk/modules/generators/mod_autoindex.c Date: Mon, 10 Jun 2013 17:46:53 -0000 To: cvs@httpd.apache.org From: rjung@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130610174653.B797F23889ED@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: rjung Date: Mon Jun 10 17:46:53 2013 New Revision: 1491538 URL: http://svn.apache.org/r1491538 Log: Reduce stack usage, 32 bytes are enough here, no need to take 8k in the stack. (19 would be enough, but be safe...) Use the size of the buffer as opposed to MAX_STRING_LEN. Followup to r1491221+r1491479: change consistently the same code used in another place in the same file. Modified: httpd/httpd/trunk/modules/generators/mod_autoindex.c Modified: httpd/httpd/trunk/modules/generators/mod_autoindex.c URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/generators/mod_autoindex.c?rev=1491538&r1=1491537&r2=1491538&view=diff ============================================================================== --- httpd/httpd/trunk/modules/generators/mod_autoindex.c (original) +++ httpd/httpd/trunk/modules/generators/mod_autoindex.c Mon Jun 10 17:46:53 2013 @@ -1752,10 +1752,10 @@ static void output_directories(struct en } if (!(autoindex_opts & SUPPRESS_LAST_MOD)) { if (ar[x]->lm != -1) { - char time_str[MAX_STRING_LEN]; + char time_str[32]; apr_time_exp_t ts; apr_time_exp_lt(&ts, ar[x]->lm); - apr_strftime(time_str, &rv, MAX_STRING_LEN, + apr_strftime(time_str, &rv, sizeof(time_str), "%Y-%m-%d %H:%M ", &ts); ap_rvputs(r, "style_sheet != NULL) ? " class=\"indexcollastmod\">" : " align=\"right\">",time_str, NULL);