From 156fd1c31592b821c170b5567b2fc81060359232 Mon Sep 17 00:00:00 2001
From: Jonathan McDowell <noodles@earth.li>
Date: Mon, 31 May 2004 23:47:57 +0000
Subject: [PATCH] cscvs to tla changeset 98 Author: noodles Date: 2003/09/30
 17:40:41 Fix stupid bug with read_openpgp_stream and an empty packet list.

---
 parsekey.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/parsekey.c b/parsekey.c
index ea56f83..9cdb90c 100644
--- a/parsekey.c
+++ b/parsekey.c
@@ -5,7 +5,7 @@
  *
  * Copyright 2002 Project Purple
  *
- * $Id: parsekey.c,v 1.11 2003/09/30 16:58:04 noodles Exp $
+ * $Id: parsekey.c,v 1.12 2003/09/30 17:40:41 noodles Exp $
  */
 
 #include <assert.h>
@@ -180,8 +180,10 @@ int read_openpgp_stream(int (*getchar_func)(void *ctx, size_t count,
 
 	assert(packets != NULL);
 	curpacket = *packets;
-	while (curpacket->next != NULL) {
-		curpacket = curpacket->next;
+	if (curpacket != NULL) {
+		while (curpacket->next != NULL) {
+			curpacket = curpacket->next;
+		}
 	}
 
 	while (!rc && !getchar_func(ctx, 1, &curchar)) {
-- 
2.39.5