From 3e9918a707f9b3dac03dd5c52d494cb090f1fcc6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Henrik=20Grubbstr=C3=B6m=20=28Grubba=29?=
 <grubba@grubba.org>
Date: Sun, 29 Jun 2008 23:08:14 +0200
Subject: [PATCH] fixed bug in check_string().

Rev: src/stralloc.c:1.225
---
 src/stralloc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/stralloc.c b/src/stralloc.c
index f350108208..2fb5e89fa5 100644
--- a/src/stralloc.c
+++ b/src/stralloc.c
@@ -2,7 +2,7 @@
 || This file is part of Pike. For copyright information see COPYRIGHT.
 || Pike is distributed under GPL, LGPL and MPL. See the file COPYING
 || for more information.
-|| $Id: stralloc.c,v 1.224 2008/06/29 17:56:06 nilsson Exp $
+|| $Id: stralloc.c,v 1.225 2008/06/29 21:08:14 grubba Exp $
 */
 
 #include "global.h"
@@ -1196,7 +1196,7 @@ PMOD_EXPORT void check_string(struct pike_string *s)
 	ptrdiff_t i;
 	p_wchar2 *str = STR2 (s);
 	for (i = 0; i < s->len; i++)
-	  if (str[i] > 0xffff)
+	  if ((str[i] > 0xffff) || (str[i] < 0))
 	    goto size_shift_check_done;
 	Pike_fatal ("Shared string is too wide.\n");
       }
-- 
GitLab