diff options
author | monty@narttu.mysql.fi <> | 2003-08-28 06:08:17 +0300 |
---|---|---|
committer | monty@narttu.mysql.fi <> | 2003-08-28 06:08:17 +0300 |
commit | 8a77f97079d0d51ccc58340c258c275de122dadd (patch) | |
tree | 41b52ce07c94e5878b59ffb52bf26ad79aa89469 /myisam/mi_dynrec.c | |
parent | c24e0fcc46c08d14a456e2b64ae7b9e43b988c99 (diff) | |
download | mariadb-git-8a77f97079d0d51ccc58340c258c275de122dadd.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
Diffstat (limited to 'myisam/mi_dynrec.c')
-rw-r--r-- | myisam/mi_dynrec.c | 13 |
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); } |