[xiph-commits] r18901 - icecast/trunk/icecast/src

ph3-der-loewe at svn.xiph.org ph3-der-loewe at svn.xiph.org
Tue Apr 2 05:19:34 PDT 2013


Author: ph3-der-loewe
Date: 2013-04-02 05:19:33 -0700 (Tue, 02 Apr 2013)
New Revision: 18901

Modified:
   icecast/trunk/icecast/src/logging.c
Log:
Throw away the reqbuf stuff as it was not well designed. Removing it and restoring usage of %H *fixes* #1942 not just workaround it with opening security holes. close #1942

Modified: icecast/trunk/icecast/src/logging.c
===================================================================
--- icecast/trunk/icecast/src/logging.c	2013-04-02 12:17:43 UTC (rev 18900)
+++ icecast/trunk/icecast/src/logging.c	2013-04-02 12:19:33 UTC (rev 18901)
@@ -120,7 +120,6 @@
 void logging_access(client_t *client)
 {
     char datebuf[128];
-    char reqbuf[1024];
     struct tm thetime;
     time_t now;
     time_t stayed;
@@ -136,12 +135,6 @@
 #else
     strftime (datebuf, sizeof(datebuf), LOGGING_FORMAT_CLF, &thetime);
 #endif
-    /* build the request */
-    snprintf (reqbuf, sizeof(reqbuf), "%s %s %s/%s",
-            httpp_getvar (client->parser, HTTPP_VAR_REQ_TYPE),
-            httpp_getvar (client->parser, HTTPP_VAR_URI),
-            httpp_getvar (client->parser, HTTPP_VAR_PROTOCOL),
-            httpp_getvar (client->parser, HTTPP_VAR_VERSION));
 
     stayed = now - client->con->con_time;
 
@@ -159,11 +152,14 @@
         user_agent = "-";
 
     log_write_direct (accesslog,
-            "%s - %s [%s] \"%s\" %d %" PRIu64 " \"%s\" \"%s\" %lu",
+            "%s - %H [%s] \"%H %H %H/%H\" %d %" PRIu64 " \"% H\" \"% H\" %lu",
             client->con->ip,
             username,
             datebuf,
-            reqbuf,
+            httpp_getvar (client->parser, HTTPP_VAR_REQ_TYPE),
+            httpp_getvar (client->parser, HTTPP_VAR_URI),
+            httpp_getvar (client->parser, HTTPP_VAR_PROTOCOL),
+            httpp_getvar (client->parser, HTTPP_VAR_VERSION),
             client->respcode,
             client->con->sent_bytes,
             referrer,



More information about the commits mailing list