Procházet zdrojové kódy

libdpkg: Do not dereference NULL pointers on dpkg_arch_remove()

Regression introduced in commit 1c1c2f7dc4b191f665f7cf7d8f70e7b66f942212.
Guillem Jover před 14 roky
rodič
revize
4d0ff8d19f
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  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;