diff -Nura openssl-SNAP-20101122.orig/crypto/pkcs12/p12_key.c openssl-SNAP-20101122.work/crypto/pkcs12/p12_key.c
--- openssl-SNAP-20101122.orig/crypto/pkcs12/p12_key.c	2010-10-12 02:00:23.000000000 +0200
+++ openssl-SNAP-20101122.work/crypto/pkcs12/p12_key.c	2010-11-22 16:29:53.421383655 +0100
@@ -176,8 +176,10 @@
 		out += u;
 		for (j = 0; j < v; j++) B[j] = Ai[j % u];
 		/* Work out B + 1 first then can use B as tmp space */
-		BN_bin2bn (B, v, Bpl1);
-		BN_add_word (Bpl1, 1);
+		if (!BN_bin2bn (B, v, Bpl1))
+			goto err;
+		if (!BN_add_word (Bpl1, 1))
+			goto err;
 		for (j = 0; j < Ilen ; j+=v) {
 			if (!BN_bin2bn(I + j, v, Ij))
 				goto err;
