From 80314102fea3deac6a30827e65a55b8cce760446 Mon Sep 17 00:00:00 2001 From: Nick Bowler Date: Wed, 15 Jul 2009 21:59:18 -0400 Subject: [PATCH] upkg: fix NULL dereference if upkg_export_class fails. --- src/upkg.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/upkg.c b/src/upkg.c index 87794cb..4a76fa2 100644 --- a/src/upkg.c +++ b/src/upkg.c @@ -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; -- 2.43.0