add a few missing null pointer checks, and fix check vs dereference order in some...
[project/uci.git] / file.c
diff --git a/file.c b/file.c
index 0530eb2..4eb35b1 100644 (file)
--- a/file.c
+++ b/file.c
@@ -619,7 +619,7 @@ int uci_import(struct uci_context *ctx, FILE *stream, const char *name, struct u
        uci_alloc_parse_context(ctx);
        pctx = ctx->pctx;
        pctx->file = stream;
-       if (*package && single) {
+       if (package && *package && single) {
                pctx->package = *package;
                pctx->merge = true;
        }