Message387212
sqlite3_column_bytes() should be called _after_ sqlite3_column_blob(). There two calls to sqlite3_column_blob() are both preceeded by calls to sqlite3_column_bytes(). Currently it does not do any harm, but it is bad API usage.
I suggest to fix the two cases, and add a comment in the source code as a reminder.
Berker?
Quoting from https://sqlite.org/c3ref/column_blob.html:
The safest policy is to invoke these routines in one of the following ways:
* sqlite3_column_text() followed by sqlite3_column_bytes()
* sqlite3_column_blob() followed by sqlite3_column_bytes()
* sqlite3_column_text16() followed by sqlite3_column_bytes16()
In other words, you should call sqlite3_column_text(), sqlite3_column_blob(), or sqlite3_column_text16() first to force the result into the desired format, then invoke sqlite3_column_bytes() or sqlite3_column_bytes16() to find the size of the result. |
|
Date |
User |
Action |
Args |
2021-02-18 11:14:23 | erlendaasland | set | recipients:
+ erlendaasland, berker.peksag, serhiy.storchaka |
2021-02-18 11:14:23 | erlendaasland | set | messageid: <1613646863.88.0.107963073708.issue43249@roundup.psfhosted.org> |
2021-02-18 11:14:23 | erlendaasland | link | issue43249 messages |
2021-02-18 11:14:23 | erlendaasland | create | |
|