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
5503d473
Kaydet (Commit)
5503d473
authored
Mar 27, 2016
tarafından
Martin Panter
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #26644: Raise ValueError for negative SSLSocket.recv() and read()
üst
13f0c616
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
0 deletions
+19
-0
test_ssl.py
Lib/test/test_ssl.py
+11
-0
NEWS
Misc/NEWS
+3
-0
_ssl.c
Modules/_ssl.c
+5
-0
No files found.
Lib/test/test_ssl.py
Dosyayı görüntüle @
5503d473
...
@@ -2792,6 +2792,13 @@ else:
...
@@ -2792,6 +2792,13 @@ else:
# consume data
# consume data
s
.
read
()
s
.
read
()
# read(-1, buffer) is supported, even though read(-1) is not
data
=
b
"data"
s
.
send
(
data
)
buffer
=
bytearray
(
len
(
data
))
self
.
assertEqual
(
s
.
read
(
-
1
,
buffer
),
len
(
data
))
self
.
assertEqual
(
buffer
,
data
)
# Make sure sendmsg et al are disallowed to avoid
# Make sure sendmsg et al are disallowed to avoid
# inadvertent disclosure of data and/or corruption
# inadvertent disclosure of data and/or corruption
# of the encrypted data stream
# of the encrypted data stream
...
@@ -2801,6 +2808,10 @@ else:
...
@@ -2801,6 +2808,10 @@ else:
s
.
recvmsg_into
,
bytearray
(
100
))
s
.
recvmsg_into
,
bytearray
(
100
))
s
.
write
(
b
"over
\n
"
)
s
.
write
(
b
"over
\n
"
)
self
.
assertRaises
(
ValueError
,
s
.
recv
,
-
1
)
self
.
assertRaises
(
ValueError
,
s
.
read
,
-
1
)
s
.
close
()
s
.
close
()
def
test_nonblocking_send
(
self
):
def
test_nonblocking_send
(
self
):
...
...
Misc/NEWS
Dosyayı görüntüle @
5503d473
...
@@ -94,6 +94,9 @@ Core and Builtins
...
@@ -94,6 +94,9 @@ Core and Builtins
Library
Library
-------
-------
- Issue #26644: Raise ValueError rather than SystemError when a negative
length is passed to SSLSocket.recv() or read().
- Issue #26616: Fixed a bug in datetime.astimezone() method.
- Issue #26616: Fixed a bug in datetime.astimezone() method.
- Issue #21925: :func:`warnings.formatwarning` now catches exceptions on
- Issue #21925: :func:`warnings.formatwarning` now catches exceptions on
...
...
Modules/_ssl.c
Dosyayı görüntüle @
5503d473
...
@@ -1895,6 +1895,11 @@ _ssl__SSLSocket_read_impl(PySSLSocket *self, int len, int group_right_1,
...
@@ -1895,6 +1895,11 @@ _ssl__SSLSocket_read_impl(PySSLSocket *self, int len, int group_right_1,
_PyTime_t
timeout
,
deadline
=
0
;
_PyTime_t
timeout
,
deadline
=
0
;
int
has_timeout
;
int
has_timeout
;
if
(
!
group_right_1
&&
len
<
0
)
{
PyErr_SetString
(
PyExc_ValueError
,
"size should not be negative"
);
return
NULL
;
}
if
(
sock
!=
NULL
)
{
if
(
sock
!=
NULL
)
{
if
(((
PyObject
*
)
sock
)
==
Py_None
)
{
if
(((
PyObject
*
)
sock
)
==
Py_None
)
{
_setSSLError
(
"Underlying socket connection gone"
,
_setSSLError
(
"Underlying socket connection gone"
,
...
...
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