From: Jonathan McDowell Date: Mon, 31 May 2004 23:47:57 +0000 (+0000) Subject: cscvs to tla changeset 98 X-Git-Tag: 0.2.1~13 X-Git-Url: https://the.earth.li/gitweb/?a=commitdiff_plain;h=156fd1c31592b821c170b5567b2fc81060359232;p=onak.git 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. --- 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 @@ -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)) {