diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2010-05-19 01:27:23 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2010-05-19 01:27:23 (GMT) |
commit | 8699950b04343afe37e9dcdce87028ba0f56827b (patch) | |
tree | eae09cfadd1474a6cdb5a5b23f8d0bf03ae239c2 /Modules/_sqlite/cursor.c | |
parent | f6c578328c419f25dea91425479a6ceeb891b04d (diff) | |
download | cpython-8699950b04343afe37e9dcdce87028ba0f56827b.zip cpython-8699950b04343afe37e9dcdce87028ba0f56827b.tar.gz cpython-8699950b04343afe37e9dcdce87028ba0f56827b.tar.bz2 |
Issue #6697: Check that _PyUnicode_AsString() result is not NULL in _sqlite
Strip also some trailing spaces
Diffstat (limited to 'Modules/_sqlite/cursor.c')
-rw-r--r-- | Modules/_sqlite/cursor.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/_sqlite/cursor.c b/Modules/_sqlite/cursor.c index 5431112..97908a3 100644 --- a/Modules/_sqlite/cursor.c +++ b/Modules/_sqlite/cursor.c @@ -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 */ |