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
d648f64a
Kaydet (Commit)
d648f64a
authored
Tem 19, 2008
tarafından
Bob Ippolito
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#3322: bounds checking for _json.scanstring
üst
0147a761
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
_json.c
Modules/_json.c
+10
-2
No files found.
Modules/_json.c
Dosyayı görüntüle @
d648f64a
...
...
@@ -235,6 +235,10 @@ scanstring_str(PyObject *pystr, Py_ssize_t end, char *encoding, int strict)
if
(
chunks
==
NULL
)
{
goto
bail
;
}
if
(
end
<
0
||
len
<=
end
)
{
PyErr_SetString
(
PyExc_ValueError
,
"end is out of bounds"
);
goto
bail
;
}
while
(
1
)
{
/* Find the end of the string or the next escape */
Py_UNICODE
c
=
0
;
...
...
@@ -245,7 +249,7 @@ scanstring_str(PyObject *pystr, Py_ssize_t end, char *encoding, int strict)
break
;
}
else
if
(
strict
&&
c
<=
0x1f
)
{
raise_errmsg
(
"Invalid control character at"
,
pystr
,
begin
);
raise_errmsg
(
"Invalid control character at"
,
pystr
,
next
);
goto
bail
;
}
}
...
...
@@ -396,6 +400,10 @@ scanstring_unicode(PyObject *pystr, Py_ssize_t end, int strict)
if
(
chunks
==
NULL
)
{
goto
bail
;
}
if
(
end
<
0
||
len
<=
end
)
{
PyErr_SetString
(
PyExc_ValueError
,
"end is out of bounds"
);
goto
bail
;
}
while
(
1
)
{
/* Find the end of the string or the next escape */
Py_UNICODE
c
=
0
;
...
...
@@ -406,7 +414,7 @@ scanstring_unicode(PyObject *pystr, Py_ssize_t end, int strict)
break
;
}
else
if
(
strict
&&
c
<=
0x1f
)
{
raise_errmsg
(
"Invalid control character at"
,
pystr
,
begin
);
raise_errmsg
(
"Invalid control character at"
,
pystr
,
next
);
goto
bail
;
}
}
...
...
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