1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-30 19:03:16 +03:00

Make sure memory malloced() for structures is aligned on an even byte boundry.

Solaris segfaults otherwise. (CVS 753)

FossilOrigin-Name: 14ebe30bf5937effdc388e23e998ba1a34fb0a29
This commit is contained in:
drh
2002-09-21 15:57:57 +00:00
parent 3e56c04c4e
commit df68f6b768
3 changed files with 12 additions and 11 deletions

View File

@ -1,5 +1,5 @@
C Fix\sa\sbug\sin\sthe\sOP_MemStore\soperator\sof\sthe\sVDBE.\s\sA\srealloc()\smight\noccur\sbut\spointer\sto\sthe\sold\sbuffer\swere\snot\sbeing\smoved\sover\sto\nthe\snew\sbuffer.\s(CVS\s752) C Make\ssure\smemory\smalloced()\sfor\sstructures\sis\saligned\son\san\seven\sbyte\sboundry.\nSolaris\ssegfaults\sotherwise.\s(CVS\s753)
D 2002-09-17T03:20:46 D 2002-09-21T15:57:57
F Makefile.in d6c9a85c2a5e696843201d090dcf8bf2f8716f2a F Makefile.in d6c9a85c2a5e696843201d090dcf8bf2f8716f2a
F Makefile.linux-gcc b86a99c493a5bfb402d1d9178dcdc4bd4b32f906 F Makefile.linux-gcc b86a99c493a5bfb402d1d9178dcdc4bd4b32f906
F README f1de682fbbd94899d50aca13d387d1b3fd3be2dd F README f1de682fbbd94899d50aca13d387d1b3fd3be2dd
@ -20,7 +20,7 @@ F spec.template 238f7db425a78dc1bb7682e56e3834c7270a3f5e
F sqlite.1 83f4a9d37bdf2b7ef079a82d54eaf2e3509ee6ea F sqlite.1 83f4a9d37bdf2b7ef079a82d54eaf2e3509ee6ea
F src/btree.c 8024b87635c2adf133f153f1bb595125ec1c7d7b F src/btree.c 8024b87635c2adf133f153f1bb595125ec1c7d7b
F src/btree.h 0ca6c2631338df62e4f7894252d9347ae234eda9 F src/btree.h 0ca6c2631338df62e4f7894252d9347ae234eda9
F src/build.c d41b8da6b52ff84b235a785b226c37f3090ed276 F src/build.c 84f397a61b5bfcc1140fd41b9f8c5bda364dfea5
F src/delete.c aad9d4051ab46e6f6391ea5f7b8994a7c05bdd15 F src/delete.c aad9d4051ab46e6f6391ea5f7b8994a7c05bdd15
F src/encode.c 6c9c87d5b7b2c0101d011ebc283a80abf672a4d1 F src/encode.c 6c9c87d5b7b2c0101d011ebc283a80abf672a4d1
F src/expr.c e1327eb020a68ff7c49382e121ad4b71b3441b2a F src/expr.c e1327eb020a68ff7c49382e121ad4b71b3441b2a
@ -149,7 +149,7 @@ F www/speed.tcl a20a792738475b68756ea7a19321600f23d1d803
F www/sqlite.tcl ae3dcfb077e53833b59d4fcc94d8a12c50a44098 F www/sqlite.tcl ae3dcfb077e53833b59d4fcc94d8a12c50a44098
F www/tclsqlite.tcl 1db15abeb446aad0caf0b95b8b9579720e4ea331 F www/tclsqlite.tcl 1db15abeb446aad0caf0b95b8b9579720e4ea331
F www/vdbe.tcl 2013852c27a02a091d39a766bc87cff329f21218 F www/vdbe.tcl 2013852c27a02a091d39a766bc87cff329f21218
P f12c3a25ba5408c2a7c846a9f160416fd188cd26 P 29145746f34438bd830c763872c5e82572150357
R 3c4e79bd5ec6ce7d63d34d010c5a09db R 5d4b302464bafa2bfba8710f952a6108
U drh U drh
Z c5560c2e0285ec66000e64e43f75e92e Z dc6c63618e264b41d89885961d5df42f

View File

@ -1 +1 @@
29145746f34438bd830c763872c5e82572150357 14ebe30bf5937effdc388e23e998ba1a34fb0a29

View File

@ -25,7 +25,7 @@
** ROLLBACK ** ROLLBACK
** PRAGMA ** PRAGMA
** **
** $Id: build.c,v 1.112 2002/09/14 13:47:32 drh Exp $ ** $Id: build.c,v 1.113 2002/09/21 15:57:57 drh Exp $
*/ */
#include "sqliteInt.h" #include "sqliteInt.h"
#include <ctype.h> #include <ctype.h>
@ -1245,14 +1245,15 @@ void sqliteCreateForeignKey(
if( pFKey==0 ) goto fk_end; if( pFKey==0 ) goto fk_end;
pFKey->pFrom = p; pFKey->pFrom = p;
pFKey->pNextFrom = p->pFKey; pFKey->pNextFrom = p->pFKey;
pFKey->zTo = z = (char*)&pFKey[1]; z = (char*)&pFKey[1];
pFKey->aCol = (struct sColMap*)z;
z += sizeof(struct sColMap)*nCol;
pFKey->zTo = z;
memcpy(z, pTo->z, pTo->n); memcpy(z, pTo->z, pTo->n);
z[pTo->n] = 0; z[pTo->n] = 0;
z += pTo->n+1; z += pTo->n+1;
pFKey->pNextTo = 0; pFKey->pNextTo = 0;
pFKey->nCol = nCol; pFKey->nCol = nCol;
pFKey->aCol = (struct sColMap*)z;
z += sizeof(struct sColMap)*nCol;
if( pFromCol==0 ){ if( pFromCol==0 ){
pFKey->aCol[0].iFrom = p->nCol-1; pFKey->aCol[0].iFrom = p->nCol-1;
}else{ }else{