]> git.draconx.ca Git - upkg.git/blobdiff - src/upkg.c
upkg: fix NULL dereference if upkg_export_class fails.
[upkg.git] / src / upkg.c
index 87794cb6b1c3b6413e2d68383742a1b3c00e0b85..4a76fa2cdcbfaeb096daaf41d3f547371bd3e32d 100644 (file)
@@ -202,6 +202,10 @@ int package_export(struct upkg *pkg)
 
        for (unsigned i = 0; i < pkg->export_count; i++) {
                class = upkg_export_class(pkg, i, &package);
+               if (!class) {
+                       fprintf(stderr, "error getting class information.\n");
+                       return EXIT_FAILURE;
+               }
 
                type = module_get_class(package, class);
                if (!type) continue;