Skip to content

Commit 7e04c75

Browse files
committed
fix N(^2) slice in _feed_data_to_buffered_proto
1 parent 32104a1 commit 7e04c75

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

Lib/asyncio/protocols.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,8 @@ def _feed_data_to_buffered_proto(proto, data):
210210
proto.buffer_updated(data_len)
211211
return
212212
else:
213+
if not isinstance(data, memoryview):
214+
data = memoryview(data)
213215
buf[:buf_len] = data[:buf_len]
214216
proto.buffer_updated(buf_len)
215217
data = data[buf_len:]

0 commit comments

Comments
 (0)