From 8732b5857e51ae317ec90bd215bfd3cce0df3dd9 Mon Sep 17 00:00:00 2001
From: Martin Stjernholm <mast@lysator.liu.se>
Date: Fri, 24 Nov 2000 06:41:02 +0100
Subject: [PATCH] Fixed missing type checks when casting int arrays to strings
 with shift 2.

Rev: src/opcodes.c:1.93
---
 src/opcodes.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/opcodes.c b/src/opcodes.c
index 70bbd11347..020f656a79 100644
--- a/src/opcodes.c
+++ b/src/opcodes.c
@@ -26,7 +26,7 @@
 #include "bignum.h"
 #include "operators.h"
 
-RCSID("$Id: opcodes.c,v 1.92 2000/11/12 10:18:49 sigge Exp $");
+RCSID("$Id: opcodes.c,v 1.93 2000/11/24 05:41:02 mast Exp $");
 
 void index_no_free(struct svalue *to,struct svalue *what,struct svalue *ind)
 {
@@ -328,6 +328,9 @@ void o_cast(struct pike_string *type, INT32 run_time_type)
 		  shift = 1;
 		  if (val > 0xffff) {
 		    shift = 2;
+		    while(i--)
+		      if (a->item[i].type != T_INT)
+			error("cast: Item %d is not an integer.\n", i);
 		    break;
 		  }
 		  while(i--) {
@@ -337,6 +340,9 @@ void o_cast(struct pike_string *type, INT32 run_time_type)
 		    val = (unsigned INT32)a->item[i].u.integer;
 		    if (val > 0xffff) {
 		      shift = 2;
+		      while(i--)
+			if (a->item[i].type != T_INT)
+			  error("cast: Item %d is not an integer.\n", i);
 		      break;
 		    }
 		  }
-- 
GitLab