validate the package name for import
[project/uci.git] / file.c
diff --git a/file.c b/file.c
index afa57bf..eb05d25 100644 (file)
--- a/file.c
+++ b/file.c
@@ -755,7 +755,7 @@ int uci_load(struct uci_context *ctx, const char *name, struct uci_package **pac
        FILE *file = NULL;
 
        UCI_HANDLE_ERR(ctx);
-       UCI_ASSERT(ctx, name != NULL);
+       UCI_ASSERT(ctx, uci_validate_name(name));
 
        switch (name[0]) {
        case '.':
@@ -782,7 +782,7 @@ int uci_load(struct uci_context *ctx, const char *name, struct uci_package **pac
        file = uci_open_stream(ctx, filename, SEEK_SET, false, false);
        ctx->errno = 0;
        UCI_TRAP_SAVE(ctx, done);
-       uci_import(ctx, file, name, package, true);
+       UCI_INTERNAL(uci_import, ctx, file, name, package, true);
        UCI_TRAP_RESTORE(ctx);
 
        if (*package) {