Skip to content

Commit c657dd1

Browse files
committed
don't write more than what was read
1 parent 91cd775 commit c657dd1

File tree

1 file changed

+1
-1
lines changed
  • graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/socket

1 file changed

+1
-1
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/socket/SocketBuiltins.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ Object recvInto(PSocket socket, PByteArray buffer) {
347347
int length = fillBuffer(socket, targetBuffer);
348348
// TODO: seems dirty, is there a better way to fill a byte array?
349349

350-
for (int i = 0; i < targetBuffer.length; i++) {
350+
for (int i = 0; i < length; i++) {
351351
buffer.getSequenceStorage().insertItem(i, targetBuffer[i]);
352352
}
353353

0 commit comments

Comments
 (0)