X-Git-Url: https://git.sommitrealweird.co.uk/onak.git/blobdiff_plain/c7f25997d3d36ac30b26f663e1d257e4625662a1..156fd1c31592b821c170b5567b2fc81060359232:/parsekey.c?ds=sidebyside 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)) {