Home > Back-end >  C builder XE2 use sqlite3 database Pointer arithmetic overrun in the process
C builder XE2 use sqlite3 database Pointer arithmetic overrun in the process

Time:10-20

Using cb XE2 XE2, speaking, reading and writing database, the code is as follows:
Sqlite3 * pDB=NULL;
Char * errMsg=NULL;
Int ret=sqlite3_open (" D: \ \ 2. Db ", & amp; The pDB);
If (ret!={SQLITE_OK)
Sqlite3_close (pDB);
return;
}
The else {
Int rc=sqlite3_exec (pDB, "CREATE TABLE eng_to_chn (QString. English, Chinese QString)", 0, 0, & amp; ErrMsg);
If (rc!={SQLITE_OK)
Sqlite3_free (errMsg);
Sqlite3_close (pDB);
return;
}
}

If (pDB!=NULL)
Sqlite3_close (pDB);

Compile the following information:
2013/6/28 16:09:34 started a CodeGuard (tm) process: Project1. Exe (3320)
Pointer arithmetic overrun in the process: Project1. Exe (3320) - sqlite3. C # 59519
0 x0193d8a0 + 560, that is the at offset 848 + 560 in heap block 0 x0193d550 which is only 1032 bytes long.
0 x004431ee - sqlite3. C # 59519
0 x00443582 - sqlite3. C # 59653
0 x0046c557 - sqlite3. C # 14806
0 x004a7e32 - sqlite3. C # 43524
0 x004abca2 - sqlite3. C # 44797
0 x004ad03d - sqlite3. C # 45634
0 x004877ea - sqlite3. C # 27775
0 x00487c75 - sqlite3. C # 27867
0 x00487e4a - sqlite3. C # 27931
0 x00481e4d - sqlite3. C # 24331
0 x004b4073 - Unit1. Cpp# 33 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- sqlite3_exec row
0 x50332d75
0 x50337168
0 x50356cf5
0 x503372b8
The memory block (0 x0193d550) [size: 1032 bytes] was allocated with malloc
0 x004082b2 - sqlite3. C # 15436
0 x00409596 - sqlite3. C # 18734
0 x0040966d - sqlite3. C # 18767
0 x0040a0d7 - sqlite3. C # 19103
0 x0040a17f - sqlite3. C # 19122
0 x0044039b - sqlite3. C # 58237
0 x0044047b - sqlite3. C # 58269
0 x004405c5 - sqlite3. C # 58293
0 x0048b7d2 - sqlite3. C # 29457
0 x0046df68 - sqlite3. C # 15481
0 x004a7f52 - sqlite3. C # 43563
0 x004abca2 - sqlite3. C # 44797
0 x004acf82 - sqlite3. C # 45622
0 x004877ea - sqlite3. C # 27775
0 x00487c75 - sqlite3. C # 27867
Consult everybody down, this is due to what reason, is there a way to solve,
I a novice, thank everybody first here,

CodePudding user response:

Recommended with Unidac connection,
  • Related