Просмотр исходного кода

libdpkg: Do not dereference NULL pointers on dpkg_arch_remove()

Regression introduced in commit 1c1c2f7dc4b191f665f7cf7d8f70e7b66f942212.
Guillem Jover лет назад: 14
Родитель
Сommit
4d0ff8d19f
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      lib/dpkg/arch.c

+ 1 - 1
lib/dpkg/arch.c

@@ -249,7 +249,7 @@ dpkg_arch_remove(struct dpkg_arch *arch_remove)
 {
 	struct dpkg_arch *arch;
 
-	for (arch = arch_builtin_tail; arch->next; arch = arch->next) {
+	for (arch = arch_builtin_tail; arch && arch->next; arch = arch->next) {
 		if (arch->next->type != arch_foreign)
 			continue;