mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Issue #6697: Check that _PyUnicode_AsString() result is not NULL in _sqlite
Strip also some trailing spaces
This commit is contained in:
parent
f6c578328c
commit
8699950b04
4 changed files with 13 additions and 6 deletions
|
@ -368,7 +368,7 @@ PyObject* _pysqlite_fetch_one_row(pysqlite_Cursor* self)
|
|||
}
|
||||
PyOS_snprintf(buf, sizeof(buf) - 1, "Could not decode to UTF-8 column '%s' with text '%s'",
|
||||
colname , val_str);
|
||||
buf_bytes = PyByteArray_FromStringAndSize(buf, strlen(buf));
|
||||
buf_bytes = PyByteArray_FromStringAndSize(buf, strlen(buf));
|
||||
if (!buf_bytes) {
|
||||
PyErr_SetString(pysqlite_OperationalError, "Could not decode to UTF-8");
|
||||
} else {
|
||||
|
@ -533,7 +533,7 @@ PyObject* _pysqlite_query_execute(pysqlite_Cursor* self, int multiple, PyObject*
|
|||
}
|
||||
|
||||
operation_cstr = _PyUnicode_AsStringAndSize(operation, &operation_len);
|
||||
if (operation == NULL)
|
||||
if (operation_cstr == NULL)
|
||||
goto error;
|
||||
|
||||
/* reset description and rowcount */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue