summaryrefslogtreecommitdiff
path: root/myisam/mi_dynrec.c
diff options
context:
space:
mode:
authorunknown <monty@narttu.mysql.fi>2003-08-28 06:08:17 +0300
committerunknown <monty@narttu.mysql.fi>2003-08-28 06:08:17 +0300
commit26bb50a19b8c3a79a745d052c14f73a5a06e466e (patch)
tree41b52ce07c94e5878b59ffb52bf26ad79aa89469 /myisam/mi_dynrec.c
parentad4fdb79cd4c6f06a1a09e0ded07cb7e8c76f07c (diff)
downloadmariadb-git-26bb50a19b8c3a79a745d052c14f73a5a06e466e.tar.gz
Add detection of in_addr_t
Add pack_bits to pack_reclength for dynamic rows. This solves buffer a possible buffer overflow on update. (This will probably solve bug #563) Fix test for available file descriptors in mysqltest Fixed core dump bug in replication tests when running without transactional table support acconfig.h: Add detection of in_addr_t acinclude.m4: Add detection of in_addr_t configure.in: Add detection of in_addr_t extra/my_print_defaults.c: Cleanup extra/resolveip.c: Add detection of in_addr_t libmysql/dll.c: Fixed C++ commments myisam/mi_dynrec.c: Add ASSERT if allocated record length is to small myisam/mi_open.c: Add pack_bits to pack_reclength for dynamic rows. This solves buffer a possible buffer overflow on update. myisam/mi_test_all.sh: Added valgrind option to make it easier to verify tests mysql-test/include/check_var_limit.inc: Fix test for available file descriptors mysql-test/r/myisam.result: More tests mysql-test/t/myisam.test: More tests mysql-test/t/query_cache_merge.test: Fix test for available file descriptors mysys/default.c: Cleanup mysys/my_pthread.c: Remove C++ comments sql/log.cc: Code cleanup Fixed core dump bug in replication tests when running without transactional table support.
Diffstat (limited to 'myisam/mi_dynrec.c')
-rw-r--r--myisam/mi_dynrec.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/myisam/mi_dynrec.c b/myisam/mi_dynrec.c
index faf86c3ffbd..eb38a058b0b 100644
--- a/myisam/mi_dynrec.c
+++ b/myisam/mi_dynrec.c
@@ -58,11 +58,11 @@ int _mi_write_blob_record(MI_INFO *info, const byte *record)
{
byte *rec_buff;
int error;
- ulong reclength,extra;
+ ulong reclength,reclength2,extra;
extra= (ALIGN_SIZE(MI_MAX_DYN_BLOCK_HEADER)+MI_SPLIT_LENGTH+
MI_DYN_DELETE_BLOCK_HEADER+1);
- reclength= (info->s->base.pack_reclength + info->s->base.pack_bits +
+ reclength= (info->s->base.pack_reclength +
_my_calc_total_blob_length(info,record)+ extra);
#ifdef NOT_USED /* We now support big rows */
if (reclength > MI_DYN_MAX_ROW_LENGTH)
@@ -76,10 +76,13 @@ int _mi_write_blob_record(MI_INFO *info, const byte *record)
my_errno=ENOMEM;
return(-1);
}
- reclength=_mi_rec_pack(info,rec_buff+ALIGN_SIZE(MI_MAX_DYN_BLOCK_HEADER),
- record);
+ reclength2= _mi_rec_pack(info,rec_buff+ALIGN_SIZE(MI_MAX_DYN_BLOCK_HEADER),
+ record);
+ DBUG_PRINT("info",("reclength: %lu reclength2: %lu",
+ reclength, reclength2));
+ DBUG_ASSERT(reclength2 <= reclength);
error=write_dynamic_record(info,rec_buff+ALIGN_SIZE(MI_MAX_DYN_BLOCK_HEADER),
- reclength);
+ reclength2);
my_afree(rec_buff);
return(error);
}