Преглед на файлове

android: Don't allow access to the asset tree with a path of "".

Reference Issue #15587.
Ryan C. Gordon преди 22 часа
родител
ревизия
be97a18d82
променени са 1 файла, в които са добавени 5 реда и са изтрити 0 реда
  1. 5 0
      src/core/android/SDL_android.c

+ 5 - 0
src/core/android/SDL_android.c

@@ -1902,6 +1902,11 @@ static APKNode *FindAPKChildNode(APKNode *parent, const char *child)
 static const APKNode *FindAPKNode(const char *constpath)
 {
     //SDL_Log("FindAPKNode('%s') ...", constpath);
+
+    if (*constpath == '\0') {  // don't allow paths of "".
+        return NULL;
+    }
+
     if (SDL_strncmp(constpath, "assets://", 9) == 0) {
         constpath += 9;
     }