Pārlūkot izejas kodu

Fix: mg_upload file created with \ character (issue #51)

bel 10 gadi atpakaļ
vecāks
revīzija
a65d96375a
1 mainītis faili ar 2 papildinājumiem un 0 dzēšanām
  1. 2 0
      src/civetweb.c

+ 2 - 0
src/civetweb.c

@@ -5553,6 +5553,8 @@ int mg_upload(struct mg_connection *conn, const char *destination_dir)
         if ((s = strrchr(fname, '/')) == NULL &&
             (s = strrchr(fname, '\\')) == NULL) {
             s = fname;
+        } else {
+            s++;
         }
 
         /* Open file in binary mode. TODO: set an exclusive lock. */