Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
28cf368c
Kaydet (Commit)
28cf368c
authored
Ock 14, 2014
tarafından
Benjamin Peterson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
complain when nbytes > buflen to fix possible buffer overflow (closes #20246)
üst
aec3065b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
0 deletions
+17
-0
test_socket.py
Lib/test/test_socket.py
+10
-0
ACKS
Misc/ACKS
+1
-0
NEWS
Misc/NEWS
+2
-0
socketmodule.c
Modules/socketmodule.c
+4
-0
No files found.
Lib/test/test_socket.py
Dosyayı görüntüle @
28cf368c
...
@@ -1620,6 +1620,16 @@ class BufferIOTest(SocketConnectedTest):
...
@@ -1620,6 +1620,16 @@ class BufferIOTest(SocketConnectedTest):
_testRecvFromIntoMemoryview
=
_testRecvFromIntoArray
_testRecvFromIntoMemoryview
=
_testRecvFromIntoArray
def
testRecvFromIntoSmallBuffer
(
self
):
# See issue #20246.
buf
=
bytearray
(
8
)
self
.
assertRaises
(
ValueError
,
self
.
cli_conn
.
recvfrom_into
,
buf
,
1024
)
def
_testRecvFromIntoSmallBuffer
(
self
):
with
test_support
.
check_py3k_warnings
():
buf
=
buffer
(
MSG
*
2048
)
self
.
serv_conn
.
send
(
buf
)
TIPC_STYPE
=
2000
TIPC_STYPE
=
2000
TIPC_LOWER
=
200
TIPC_LOWER
=
200
...
...
Misc/ACKS
Dosyayı görüntüle @
28cf368c
...
@@ -979,6 +979,7 @@ Eric V. Smith
...
@@ -979,6 +979,7 @@ Eric V. Smith
Christopher Smith
Christopher Smith
Gregory P. Smith
Gregory P. Smith
Roy Smith
Roy Smith
Ryan Smith-Roberts
Rafal Smotrzyk
Rafal Smotrzyk
Dirk Soede
Dirk Soede
Paul Sokolovsky
Paul Sokolovsky
...
...
Misc/NEWS
Dosyayı görüntüle @
28cf368c
...
@@ -35,6 +35,8 @@ Core and Builtins
...
@@ -35,6 +35,8 @@ Core and Builtins
Library
Library
-------
-------
- Issue #20246: Fix buffer overflow in socket.recvfrom_into.
- Issue #19082: Working SimpleXMLRPCServer and xmlrpclib examples, both in
- Issue #19082: Working SimpleXMLRPCServer and xmlrpclib examples, both in
modules and documentation.
modules and documentation.
...
...
Modules/socketmodule.c
Dosyayı görüntüle @
28cf368c
...
@@ -2742,6 +2742,10 @@ sock_recvfrom_into(PySocketSockObject *s, PyObject *args, PyObject* kwds)
...
@@ -2742,6 +2742,10 @@ sock_recvfrom_into(PySocketSockObject *s, PyObject *args, PyObject* kwds)
if
(
recvlen
==
0
)
{
if
(
recvlen
==
0
)
{
/* If nbytes was not specified, use the buffer's length */
/* If nbytes was not specified, use the buffer's length */
recvlen
=
buflen
;
recvlen
=
buflen
;
}
else
if
(
recvlen
>
buflen
)
{
PyErr_SetString
(
PyExc_ValueError
,
"nbytes is greater than the length of the buffer"
);
goto
error
;
}
}
readlen
=
sock_recvfrom_guts
(
s
,
buf
.
buf
,
recvlen
,
flags
,
&
addr
);
readlen
=
sock_recvfrom_guts
(
s
,
buf
.
buf
,
recvlen
,
flags
,
&
addr
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment