1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-10-27 08:52:26 +03:00

Fix an alignment problem in the sqlite3OsRandomSeed(). Ticket #1584. (CVS 2872)

FossilOrigin-Name: 373b56f0048fd6a1946a97acfcca40fd12f7d572
This commit is contained in:
drh
2006-01-06 14:46:46 +00:00
parent 7887942e38
commit 0739723d76
3 changed files with 10 additions and 8 deletions

View File

@@ -1,5 +1,5 @@
C Remove\svestigial\sfile:\scrashtest1.c\s(CVS\s2871) C Fix\san\salignment\sproblem\sin\sthe\ssqlite3OsRandomSeed().\s\sTicket\s#1584.\s(CVS\s2872)
D 2006-01-06T14:41:54 D 2006-01-06T14:46:47
F Makefile.in c79fbdaa264c6afcd435f2fb492551de5a8cf80d F Makefile.in c79fbdaa264c6afcd435f2fb492551de5a8cf80d
F Makefile.linux-gcc aee18d8a05546dcf1888bd4547e442008a49a092 F Makefile.linux-gcc aee18d8a05546dcf1888bd4547e442008a49a092
F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028 F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
@@ -55,7 +55,7 @@ F src/os.h 6e61d5e901dfec761660707e892890f6760b5e63
F src/os_common.h 78bcc34dded9b625b3c16d072b7e5b76d075a674 F src/os_common.h 78bcc34dded9b625b3c16d072b7e5b76d075a674
F src/os_test.c 49833426101f99aee4bb5f6a44b7c4b2029fda1c F src/os_test.c 49833426101f99aee4bb5f6a44b7c4b2029fda1c
F src/os_test.h 903c93554c23d88f34f667f1979e4a1cee792af3 F src/os_test.h 903c93554c23d88f34f667f1979e4a1cee792af3
F src/os_unix.c d220bf3721357581214f261f8c6028060930177d F src/os_unix.c 1ade7cd84c6f18dd2ceb98000ea1e9bdcac256ff
F src/os_unix.h 5768d56d28240d3fe4537fac08cc85e4fb52279e F src/os_unix.h 5768d56d28240d3fe4537fac08cc85e4fb52279e
F src/os_win.c 3239b124d2400ed30d213053df43dc29405d018f F src/os_win.c 3239b124d2400ed30d213053df43dc29405d018f
F src/os_win.h 41a946bea10f61c158ce8645e7646b29d44f122b F src/os_win.h 41a946bea10f61c158ce8645e7646b29d44f122b
@@ -335,7 +335,7 @@ F www/tclsqlite.tcl bb0d1357328a42b1993d78573e587c6dcbc964b9
F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
F www/version3.tcl a99cf5f6d8bd4d5537584a2b342f0fb9fa601d8b F www/version3.tcl a99cf5f6d8bd4d5537584a2b342f0fb9fa601d8b
F www/whentouse.tcl 97e2b5cd296f7d8057e11f44427dea8a4c2db513 F www/whentouse.tcl 97e2b5cd296f7d8057e11f44427dea8a4c2db513
P 2529c2e11fa1d345ec61f647e4f6fae20a7133d6 P 6676c7031d81202ad702142ecf9e64f14d94d968
R 9f9ead22d0bda9c720999a0d4a57571c R 1b60a9ed7b0ca6bc19ad7d05130da53f
U drh U drh
Z 4e702f097766ad2e85fd323db050798c Z 4997b116ed1a6eabde161c270985eda0

View File

@@ -1 +1 @@
6676c7031d81202ad702142ecf9e64f14d94d968 373b56f0048fd6a1946a97acfcca40fd12f7d572

View File

@@ -1576,7 +1576,9 @@ int sqlite3UnixRandomSeed(char *zBuf){
int pid, fd; int pid, fd;
fd = open("/dev/urandom", O_RDONLY); fd = open("/dev/urandom", O_RDONLY);
if( fd<0 ){ if( fd<0 ){
time((time_t*)zBuf); time_t t;
time(&t);
memcpy(zBuf, &t, sizeof(t));
pid = getpid(); pid = getpid();
memcpy(&zBuf[sizeof(time_t)], &pid, sizeof(pid)); memcpy(&zBuf[sizeof(time_t)], &pid, sizeof(pid));
}else{ }else{