summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2009-09-06 13:33:34 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2009-09-06 13:33:34 +0000
commit3181581146d55a2ce1ecce076f68603ba211dec7 (patch)
treee58f12a94323b903bcb509bbd4a00d485edde994
parenta0a3a8e171527337e4324fdffcbfef4e884ff9af (diff)
check for unitialized elements when accessing an array; from Simon Kellner.
-rw-r--r--usr.bin/dc/bcode.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/dc/bcode.c b/usr.bin/dc/bcode.c
index 1ab0d747bba..8949a4c4bd3 100644
--- a/usr.bin/dc/bcode.c
+++ b/usr.bin/dc/bcode.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bcode.c,v 1.38 2008/11/24 08:48:48 otto Exp $ */
+/* $OpenBSD: bcode.c,v 1.39 2009/09/06 13:33:33 otto Exp $ */
/*
* Copyright (c) 2003, Otto Moerbeek <otto@drijf.net>
@@ -17,7 +17,7 @@
*/
#ifndef lint
-static const char rcsid[] = "$OpenBSD: bcode.c,v 1.38 2008/11/24 08:48:48 otto Exp $";
+static const char rcsid[] = "$OpenBSD: bcode.c,v 1.39 2009/09/06 13:33:33 otto Exp $";
#endif /* not lint */
#include <ssl/ssl.h>
@@ -876,7 +876,7 @@ load_array(void)
else {
stack = &bmachine.reg[reg];
v = frame_retrieve(stack, idx);
- if (v == NULL) {
+ if (v == NULL || v->type == BCODE_NONE) {
n = new_number();
bn_check(BN_zero(n->number));
push_number(n);