A proper fix this time. From Sergey 'Jin' Bostandzhyan <jin@mediatomb.cc>.
[oweals/opkg-lede.git] / libopkg / file_util.c
index cf5f7740e2bed43896575bde18d91fe15ccbb688..897546e838d4d8298ddb94a2546fdbfb283371fb 100644 (file)
@@ -238,6 +238,11 @@ rm_r(const char *path)
        DIR *dir;
        struct dirent *dent;
 
+       if (path == NULL) {
+               opkg_perror(ERROR, "Missing directory parameter");
+               return -1;
+       }
+
        dir = opendir(path);
        if (dir == NULL) {
                opkg_perror(ERROR, "Failed to open dir %s", path);