Commit a4352c144d5ba52801734c45d2a39a6035084101
Fix use-after-free in sqlite queries
These std::string objects are temporary, of course we want to copy
their contents...
It worked for so long without issues, amazing.
Author: xaizek
Author date (UTC): 2022-04-20 17:56
Committer name: xaizek
Committer date (UTC): 2022-04-20 17:56
Parent(s): e59372182665e523bb5411e3a9d263c82e00fbd4
Signing key: 99DC5E4DB05F6BE2
Tree: 4d71c860a059ec045fe6609efcfbd6986f2c0c3a
File src/DB.cpp changed (mode: 100644) (index 37ba59a..66bc379) |
... |
... |
public: |
64 |
64 |
{ |
{ |
65 |
65 |
errorValue = sqlite3_bind_text(ps, idx, |
errorValue = sqlite3_bind_text(ps, idx, |
66 |
66 |
str.c_str(), str.length(), |
str.c_str(), str.length(), |
67 |
|
SQLITE_STATIC); |
|
|
67 |
|
SQLITE_TRANSIENT); |
68 |
68 |
} |
} |
69 |
69 |
|
|
70 |
70 |
/** |
/** |