From 069c89898478b0273f7e6d0ea803d6151ee74ff7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20Ter=C3=A4s?= Date: Thu, 3 Jun 2010 22:03:02 +0300 Subject: [PATCH] state: fix a crash in error printing --- src/state.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/state.c b/src/state.c index 40ab359..141f466 100644 --- a/src/state.c +++ b/src/state.c @@ -838,7 +838,7 @@ void apk_state_print_errors(struct apk_state *state) es.prevpkg = pkg = state->conflicts->item[i]; es.indent.x = es.indent.indent = printf(" %s-%s:", pkg->name->name, pkg->version); - for (j = 0; j < pkg->depends->num; j++) { + for (j = 0; pkg->depends != NULL && j < pkg->depends->num; j++) { r = apk_state_lock_dependency(state, &pkg->depends->item[j]); if (r != 0)