[phodav] server: explicitely check 'if' length (not strictly required)



commit 378bb4436ae0c7a6556f7e3d5fc4e455d0b56002
Author: Marc-André Lureau <marcandre lureau gmail com>
Date:   Sat Feb 8 16:59:55 2014 +0100

    server: explicitely check 'if' length (not strictly required)

 libphodav/phodav-server.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/libphodav/phodav-server.c b/libphodav/phodav-server.c
index cbb569a..577b026 100644
--- a/libphodav/phodav-server.c
+++ b/libphodav/phodav-server.c
@@ -2783,7 +2783,7 @@ method_lock (PathHandler *handler, SoupMessage *msg,
       const gchar *hif = soup_message_headers_get_one (msg->request_headers, "If");
       gint len = strlen (hif);
 
-      if (hif[0] != '(' || hif[1] != '<' || hif[len - 2] != '>' || hif[len - 1] != ')')
+      if (len <= 4 || hif[0] != '(' || hif[1] != '<' || hif[len - 2] != '>' || hif[len - 1] != ')')
         goto end;
 
       token = g_strndup (hif + 2, len - 4);


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