소스 검색

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;
 
-	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;