Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix 30245
  • Loading branch information
johanliu committed May 20, 2017
commit b46b18dd36a1a40aace1efb85a4f088dd6ce6a27
6 changes: 5 additions & 1 deletion Modules/_struct.c
Original file line number Diff line number Diff line change
Expand Up @@ -1929,11 +1929,15 @@ s_pack_into(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames

/* Check boundaries */
if ((buffer.len - offset) < soself->s_size) {

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove these empty lines. They look distracting.

assert(offset >= 0);
assert(soself->s_size >= 0);

PyErr_Format(StructError,
"pack_into requires a buffer of at least %zd bytes for "
"packing %zd bytes at offset %zd "
"(actual buffer size is %zd)",
soself->s_size + offset,
(size_t)soself->s_size + (size_t)offset,
soself->s_size,
offset,
buffer.len);
Expand Down