Преглед изворни кода

libdpkg: Do not dereference NULL pointers on dpkg_arch_remove()

Regression introduced in commit 1c1c2f7dc4b191f665f7cf7d8f70e7b66f942212.
Guillem Jover пре 14 година
родитељ
комит
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;
 	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)
 		if (arch->next->type != arch_foreign)
 			continue;
 			continue;