myserver-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[myserver-commit] [SCM] GNU MyServer branch, master, updated. v0.9.2-415


From: Giuseppe Scrivano
Subject: [myserver-commit] [SCM] GNU MyServer branch, master, updated. v0.9.2-415-gc03b560
Date: Tue, 25 Jan 2011 23:23:37 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU MyServer".

The branch, master has been updated
       via  c03b56017c67e5ef01346d919ed7953963074fd2 (commit)
       via  38bccf9da8aea3becb798c5fbd9dbd6627c40d62 (commit)
      from  e89e5593857788537b2a6656944cbb9ee8718dc4 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------


commit c03b56017c67e5ef01346d919ed7953963074fd2
Author: Giuseppe Scrivano <address@hidden>
Date:   Wed Jan 26 00:24:06 2011 +0100

    Avoid an invalid memory read.

diff --git a/myserver/src/base/string/stringutils.cpp 
b/myserver/src/base/string/stringutils.cpp
index f2acc2a..e1f06de 100644
--- a/myserver/src/base/string/stringutils.cpp
+++ b/myserver/src/base/string/stringutils.cpp
@@ -655,6 +655,20 @@ void gotoNextLine (char** cmd)
 
 }
 
+#define TRANSLATE_ESCAPE_STRING_BODY                                    \
+  if ((str[i] == '%') && str[i + 1] && str[i + 2])                      \
+    {                                                                   \
+      str[j] =(char) (16 * hexVal (str[i + 1]) + hexVal (str[i + 2]));  \
+      i = i + 3;                                                        \
+    }                                                                   \
+  else if (str[i] == '+')                                               \
+    str[j] = ' ';                                                       \
+  else                                                                  \
+    str[j] = str[i++];                                                  \
+                                                                        \
+  j++;
+
+
 /*!
   Translates HTTP escape sequences.
  */
@@ -665,19 +679,9 @@ void translateEscapeString (char *str)
   j = 0;
   while (str[i] != 0)
     {
-      if ((str[i] == '%') && (str[i + 1] != 0) && (str[i + 2] != 0))
-        {
-          str[j] =(char) (16 * hexVal (str[i + 1]) + hexVal (str[i + 2]));
-          i = i + 3;
-        }
-      else
-        {
-          str[j] = str[i];
-          i++;
-        }
-      j++;
+      TRANSLATE_ESCAPE_STRING_BODY
     }
-  str[j] = 0;
+  str[j] = '\0';
 }
 
 /*!
@@ -689,21 +693,12 @@ void translateEscapeString (string& str)
   i = 0;
   j = 0;
   len = str.length ();
-  while (len--)
+  while (i < len)
     {
-      if ((str[i] == '%') && (str[i + 1] != 0) && (str[i + 2] != 0))
-        {
-          str[j] =(char) (16 * hexVal (str[i + 1]) + hexVal (str[i + 2]));
-          i = i + 3;
-        }
-      else
-        {
-          str[j] = str[i];
-          i++;
-        }
-      j++;
+      TRANSLATE_ESCAPE_STRING_BODY
     }
-  str[j] = 0;
+
+  str.erase (j);
 }
 
 /*!



commit 38bccf9da8aea3becb798c5fbd9dbd6627c40d62
Author: Giuseppe Scrivano <address@hidden>
Date:   Tue Jan 25 14:56:36 2011 +0100

    Rename `yetmapped' to `mapped'.

diff --git a/myserver/include/protocol/http/dyn_http_command.h 
b/myserver/include/protocol/http/dyn_http_command.h
index e4cdaaa..dc8b5f0 100644
--- a/myserver/include/protocol/http/dyn_http_command.h
+++ b/myserver/include/protocol/http/dyn_http_command.h
@@ -39,7 +39,7 @@ public:
   virtual int acceptData () = 0;
   virtual int send (HttpThreadContext* context, ConnectionPtr connection,
                     string& Uri, bool systemrequest = false,
-                    bool onlyHeader = false, bool yetmapped = false) = 0;
+                    bool onlyHeader = false, bool mapped = false) = 0;
 private:
   string name;
 };
diff --git a/myserver/include/protocol/http/http.h 
b/myserver/include/protocol/http/http.h
index 8c9ed39..ed2cd44 100644
--- a/myserver/include/protocol/http/http.h
+++ b/myserver/include/protocol/http/http.h
@@ -85,18 +85,18 @@ public:
   int sendHTTPResource (string& filename,
                         bool systemrequest = false,
                         bool onlyHeader = false,
-                        bool yetMapped = false);
+                        bool mapped = false);
 
   int putHTTPRESOURCE (string &filename,
                        bool systemrequest = false,
                        bool onlyHeader = false,
-                       bool yetMapped = false);
+                       bool mapped = false);
 
   int optionsHTTPRESOURCE (string &filename,
-                           bool yetMapped = false);
+                           bool mapped = false);
 
   int traceHTTPRESOURCE (string& filename,
-                         bool yetMapped = false);
+                         bool mapped = false);
 
   bool allowMethod (const char *name);
 
@@ -146,12 +146,12 @@ public:
   static int loadProtocolStatic ();
 
   u_long getTimeout ();
-  int preprocessHttpRequest (string& filename, bool yetmapped,
+  int preprocessHttpRequest (string& filename, bool mapped,
                              int* permissions, bool systemrequest);
 
   int getFilePermissions (string& filename, string& directory,
                           string& file, string &filenamePath,
-                          bool yetmapped, int* permissions);
+                          bool mapped, int* permissions);
 
   SecurityToken *getSecurityToken (){return &(td->securityToken);}
   HttpProtocol *getStaticData () {return staticData;}
diff --git a/myserver/src/protocol/http/http.cpp 
b/myserver/src/protocol/http/http.cpp
index b33e70c..02fbdc8 100644
--- a/myserver/src/protocol/http/http.cpp
+++ b/myserver/src/protocol/http/http.cpp
@@ -663,7 +663,7 @@ HttpUserData::reset ()
  */
 int
 Http::sendHTTPResource (string& uri, bool systemrequest, bool onlyHeader,
-                        bool yetmapped)
+                        bool mapped)
 {
   /*
     With this code we manage a request of a file or a directory or anything
@@ -682,7 +682,7 @@ Http::sendHTTPResource (string& uri, bool systemrequest, 
bool onlyHeader,
       filename.assign (uri);
       td->buffer->setLength (0);
 
-      ret = Http::preprocessHttpRequest (filename, yetmapped, &td->permissions,
+      ret = Http::preprocessHttpRequest (filename, mapped, &td->permissions,
                                          systemrequest);
       if (ret != 200)
         return raiseHTTPError (ret);
@@ -933,11 +933,11 @@ int Http::controlConnection (ConnectionPtr a, char*, 
char*, u_long, u_long,
         staticData->getDynCmdManager ()->getHttpCommand (td->request.cmd);
 
       /* If the used method supports POST data, read it.  */
-      if ((!td->request.cmd.compare ("POST")) ||
-          (!td->request.cmd.compare ("PUT")) ||
-          (!td->request.cmd.compare ("LOCK")) ||
-          (!td->request.cmd.compare ("PROPFIND")) ||
-          (dynamicCommand && dynamicCommand->acceptData ()))
+      if ((!td->request.cmd.compare ("POST"))
+          || (!td->request.cmd.compare ("PUT"))
+          || (!td->request.cmd.compare ("LOCK"))
+          || (!td->request.cmd.compare ("PROPFIND"))
+          || (dynamicCommand && dynamicCommand->acceptData ()))
         {
           int httpErrorCode;
           int readPostRet;

-----------------------------------------------------------------------

Summary of changes:
 myserver/include/protocol/http/dyn_http_command.h |    2 +-
 myserver/include/protocol/http/http.h             |   12 +++---
 myserver/src/base/string/stringutils.cpp          |   45 +++++++++-----------
 myserver/src/protocol/http/http.cpp               |   14 +++---
 4 files changed, 34 insertions(+), 39 deletions(-)


hooks/post-receive
-- 
GNU MyServer



reply via email to

[Prev in Thread] Current Thread [Next in Thread]