file: uci_parse_package: fix heap use after free
[project/uci.git] / file.c
diff --git a/file.c b/file.c
index 6486de9c422971e6b886a2b5f2f9ef2fd0200423..23bf49a16f631070b55a0909c733a167b432dfb4 100644 (file)
--- a/file.c
+++ b/file.c
@@ -388,8 +388,8 @@ static void uci_parse_package(struct uci_context *ctx, bool single)
        pctx->pos += strlen(pctx_cur_str(pctx)) + 1;
 
        ofs_name = next_arg(ctx, true, true, true);
-       name = pctx_str(pctx, ofs_name);
        assert_eol(ctx);
+       name = pctx_str(pctx, ofs_name);
        if (single)
                return;