]> granicus.if.org Git - apache/commitdiff
Merge r1491221, r1491479, r1491538 from trunk:
authorJim Jagielski <jim@apache.org>
Wed, 12 Jun 2013 13:39:56 +0000 (13:39 +0000)
committerJim Jagielski <jim@apache.org>
Wed, 12 Jun 2013 13:39:56 +0000 (13:39 +0000)
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.

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.

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

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1492198 13f79535-47bb-0310-9956-ffa450edef68

STATUS
modules/generators/mod_autoindex.c

diff --git a/STATUS b/STATUS
index dc341b41c1911840e42ec3e335315776722c7359..0da7d19a1a94d8143b505e1db45416834562ce96 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -95,13 +95,6 @@ PATCHES PROPOSED TO BACKPORT FROM TRUNK:
   [ New proposals should be added at the end of the list ]
 
 
-    * mod_autoindex: reduce stack usage in 'output_directories' by 8k
-      trunk patch: http://svn.apache.org/r1491221
-                   http://svn.apache.org/r1491479
-                   http://svn.apache.org/r1491538
-      2.4.x patch: trunk patch works
-      +1: jailletc36, rjung, jim
-
     * mod_cache_socache: Use the name of the socache implementation when performing 
       a lookup rather than using the raw arguments. PR 55062
       trunk patch: http://svn.apache.org/r1491458
index 78a774ef1537cfd5522fe00836ba80393f65432b..3d36c77b8107e5f1782306d81f864aeba785133d 100644 (file)
@@ -1752,10 +1752,10 @@ static void output_directories(struct ent **ar, int n,
             }
             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, "</td><td", (d->style_sheet != NULL) ? " class=\"indexcollastmod\">" : " align=\"right\">",time_str, NULL);
@@ -1840,10 +1840,10 @@ static void output_directories(struct ent **ar, int n,
             ap_rputs(" ", r);
             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_rputs(time_str, r);
                 }