Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/sbin/cgdconfig/cgdconfig.c,v rcsdiff: /ftp/cvs/cvsroot/src/sbin/cgdconfig/cgdconfig.c,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.10.2.1 retrieving revision 1.11 diff -u -p -r1.10.2.1 -r1.11 --- src/sbin/cgdconfig/cgdconfig.c 2004/08/13 15:02:17 1.10.2.1 +++ src/sbin/cgdconfig/cgdconfig.c 2004/08/10 02:29:34 1.11 @@ -1,4 +1,4 @@ -/* $NetBSD: cgdconfig.c,v 1.10.2.1 2004/08/13 15:02:17 tv Exp $ */ +/* $NetBSD: cgdconfig.c,v 1.11 2004/08/10 02:29:34 rumble Exp $ */ /*- * Copyright (c) 2002, 2003 The NetBSD Foundation, Inc. @@ -41,7 +41,7 @@ __COPYRIGHT( "@(#) Copyright (c) 2002, 2003\ The NetBSD Foundation, Inc. All rights reserved."); -__RCSID("$NetBSD: cgdconfig.c,v 1.10.2.1 2004/08/13 15:02:17 tv Exp $"); +__RCSID("$NetBSD: cgdconfig.c,v 1.11 2004/08/10 02:29:34 rumble Exp $"); #endif #include @@ -272,6 +272,14 @@ getkey(const char *dev, struct keygen *k return NULL; } + if (!tmp) { + warnx("keygen method %d failed in getkey()", + kg->kg_method); + if (ret) + bits_free(ret); + return NULL; + } + if (ret) ret = bits_xor_d(tmp, ret); else @@ -735,6 +743,8 @@ generate_convert(struct params *p, int a } oldp->key = getkey("old file", oldp->keygen, oldp->keylen); + if (!oldp->key) + goto bail; /* we copy across the non-keygen info, here. */