MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:msvensson Date:July 18 2006 10:41am
Subject:bk commit into 5.0 tree (msvensson:1.2228) BUG#18539
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of msvensson. When msvensson does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2006-07-18 12:41:41+02:00, msvensson@neptunus.(none) +2 -0
  Bug#18539 uncompress(d) is null: impossible?
   - Add a check that length of field to uncompress is longer than 4 bytes.
     This can be dones as the length of uncompressed data is written as 
     first four bytes of field and thus it can't be valid compressed data.

  mysql-test/r/func_compress.result@stripped, 2006-07-18 12:41:38+02:00, msvensson@neptunus.(none) +5 -5
    Update test results

  sql/item_strfunc.cc@stripped, 2006-07-18 12:41:38+02:00, msvensson@neptunus.(none) +10 -0
    Is size of field is less than or equal to 4 bytes, indicate data is uncompressable/corrupt.

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	msvensson
# Host:	neptunus.(none)
# Root:	/home/msvensson/mysql/my50-m-bug18539

--- 1.275/sql/item_strfunc.cc	2006-07-18 12:41:47 +02:00
+++ 1.276/sql/item_strfunc.cc	2006-07-18 12:41:47 +02:00
@@ -2965,6 +2965,16 @@
   if (res->is_empty())
     return res;
 
+  /* If length is less than 4 bytes, data is corrupt */
+  if (res->length() <= 4)
+  {
+    push_warning_printf(current_thd,MYSQL_ERROR::WARN_LEVEL_ERROR,
+			ER_ZLIB_Z_DATA_ERROR,
+			ER(ER_ZLIB_Z_DATA_ERROR));
+    goto err;
+  }
+
+  /* Size of uncompressed data is stored as first 4 bytes of field */
   new_size= uint4korr(res->ptr()) & 0x3FFFFFFF;
   if (new_size > current_thd->variables.max_allowed_packet)
   {

--- 1.18/mysql-test/r/func_compress.result	2006-07-18 12:41:47 +02:00
+++ 1.19/mysql-test/r/func_compress.result	2006-07-18 12:41:47 +02:00
@@ -85,12 +85,12 @@
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	t1	system	NULL	NULL	NULL	NULL	1	
 Warnings:
-Error	1256	Uncompressed data size too large; the maximum size is 104857600 (probably, length of uncompressed data was corrupted)
+Error	1259	ZLIB: Input data corrupted
 select * from t1 where uncompress(a) is null;
 a
 foo
 Warnings:
-Error	1256	Uncompressed data size too large; the maximum size is 104857600 (probably, length of uncompressed data was corrupted)
+Error	1259	ZLIB: Input data corrupted
 explain select *, uncompress(a) from t1;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	t1	system	NULL	NULL	NULL	NULL	1	
@@ -98,12 +98,12 @@
 a	uncompress(a)
 foo	NULL
 Warnings:
-Error	1256	Uncompressed data size too large; the maximum size is 104857600 (probably, length of uncompressed data was corrupted)
+Error	1259	ZLIB: Input data corrupted
 select *, uncompress(a), uncompress(a) is null from t1;
 a	uncompress(a)	uncompress(a) is null
 foo	NULL	1
 Warnings:
-Error	1256	Uncompressed data size too large; the maximum size is 104857600 (probably, length of uncompressed data was corrupted)
-Error	1256	Uncompressed data size too large; the maximum size is 104857600 (probably, length of uncompressed data was corrupted)
+Error	1259	ZLIB: Input data corrupted
+Error	1259	ZLIB: Input data corrupted
 drop table t1;
 End of 5.0 tests
Thread
bk commit into 5.0 tree (msvensson:1.2228) BUG#18539msvensson18 Jul