X-Git-Url: https://the.earth.li/gitweb/?a=blobdiff_plain;f=parsekey.c;h=9cdb90cc514d4e825d430b951ba4ea8a8ba3657d;hb=156fd1c31592b821c170b5567b2fc81060359232;hp=ea56f835282905c905b8194db8884cfd83438c07;hpb=047b8ed75bbac19ef33690bd44746718a8261439;p=onak.git 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)) {