Skip to content

Commit

Permalink
Include length to avoid reading too much.
Browse files Browse the repository at this point in the history
  • Loading branch information
coleifer committed Apr 25, 2019
1 parent c5511c5 commit f10c415
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions playhouse/_sqlite_ext.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -335,20 +335,20 @@ cdef python_to_sqlite(sqlite3_context *context, value):
sqlite3_result_text(
context,
<const char *>bval,
-1,
len(bval),
<sqlite3_destructor_type>-1)
elif isinstance(value, bytes):
if PY_MAJOR_VERSION > 2:
sqlite3_result_blob(
context,
<void *>(<char *>value),
-1,
len(value),
<sqlite3_destructor_type>-1)
else:
sqlite3_result_text(
context,
<const char *>value,
-1,
len(value),
<sqlite3_destructor_type>-1)
else:
sqlite3_result_error(
Expand Down

0 comments on commit f10c415

Please sign in to comment.