Hi,

Here is a simple fix to prevent a crash with a function call such as
REGEXP() or REGEXP('abc') when using the icu extension. In both cases, an
unexpectedly short number of arguments causes a crash.

We're using this patch in Chromium. It was reviewed by Scott Hess.


Cheers
Chris

===
--- ext/icu/icu.c.orig 2009-12-16 15:43:51.000000000 -0800
+++ ext/icu/icu.c 2009-12-15 15:23:34.000000000 -0800
@@ -250,12 +250,12 @@
   UErrorCode status = U_ZERO_ERROR;
   URegularExpression *pExpr;
   UBool res;
-  const UChar *zString = sqlite3_value_text16(apArg[1]);
+  const UChar *zString;

   /* If the left hand side of the regexp operator is NULL,
   ** then the result is also NULL.
   */
-  if( !zString ){
+  if( nArg<2 || !(zString=sqlite3_value_text16(apArg[1])) ){
     return;
   }

===
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to