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
170ca6f8
Kaydet (Commit)
170ca6f8
authored
Nis 17, 2013
tarafından
Victor Stinner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fix bug in Unicode decoders related to _PyUnicodeWriter
Bug introduced by changesets 7ed9993d53b4 and edf029fc9591.
üst
376cfa12
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
+14
-6
unicodeobject.c
Objects/unicodeobject.c
+14
-6
No files found.
Objects/unicodeobject.c
Dosyayı görüntüle @
170ca6f8
...
@@ -4071,6 +4071,7 @@ unicode_decode_call_errorhandler_writer(
...
@@ -4071,6 +4071,7 @@ unicode_decode_call_errorhandler_writer(
PyObject *repunicode = NULL;
PyObject *repunicode = NULL;
Py_ssize_t insize;
Py_ssize_t insize;
Py_ssize_t newpos;
Py_ssize_t newpos;
Py_ssize_t replen;
PyObject *inputobj = NULL;
PyObject *inputobj = NULL;
if (*errorHandler == NULL) {
if (*errorHandler == NULL) {
...
@@ -4121,7 +4122,9 @@ unicode_decode_call_errorhandler_writer(
...
@@ -4121,7 +4122,9 @@ unicode_decode_call_errorhandler_writer(
if (PyUnicode_READY(repunicode) < 0)
if (PyUnicode_READY(repunicode) < 0)
goto onError;
goto onError;
if (PyUnicode_GET_LENGTH(repunicode) > 1)
replen = PyUnicode_GET_LENGTH(repunicode);
writer->min_length += replen;
if (replen > 1)
writer->overallocate = 1;
writer->overallocate = 1;
if (_PyUnicodeWriter_WriteStr(writer, repunicode) == -1)
if (_PyUnicodeWriter_WriteStr(writer, repunicode) == -1)
goto onError;
goto onError;
...
@@ -4660,7 +4663,8 @@ PyUnicode_DecodeUTF8Stateful(const char *s,
...
@@ -4660,7 +4663,8 @@ PyUnicode_DecodeUTF8Stateful(const char *s,
}
}
_PyUnicodeWriter_Init(&writer);
_PyUnicodeWriter_Init(&writer);
if (_PyUnicodeWriter_Prepare(&writer, size, 127) == -1)
writer.min_length = size;
if (_PyUnicodeWriter_Prepare(&writer, writer.min_length, 127) == -1)
goto onError;
goto onError;
writer.pos = ascii_decode(s, end, writer.data);
writer.pos = ascii_decode(s, end, writer.data);
...
@@ -4915,7 +4919,8 @@ PyUnicode_DecodeUTF32Stateful(const char *s,
...
@@ -4915,7 +4919,8 @@ PyUnicode_DecodeUTF32Stateful(const char *s,
#endif
#endif
_PyUnicodeWriter_Init(&writer);
_PyUnicodeWriter_Init(&writer);
if (_PyUnicodeWriter_Prepare(&writer, (e - q + 3) / 4, 127) == -1)
writer.min_length = (e - q + 3) / 4;
if (_PyUnicodeWriter_Prepare(&writer, writer.min_length, 127) == -1)
goto onError;
goto onError;
while (1) {
while (1) {
...
@@ -5154,7 +5159,8 @@ PyUnicode_DecodeUTF16Stateful(const char *s,
...
@@ -5154,7 +5159,8 @@ PyUnicode_DecodeUTF16Stateful(const char *s,
/* Note: size will always be longer than the resulting Unicode
/* Note: size will always be longer than the resulting Unicode
character count */
character count */
_PyUnicodeWriter_Init(&writer);
_PyUnicodeWriter_Init(&writer);
if (_PyUnicodeWriter_Prepare(&writer, (e - q + 1) / 2, 127) == -1)
writer.min_length = (e - q + 1) / 2;
if (_PyUnicodeWriter_Prepare(&writer, writer.min_length, 127) == -1)
goto onError;
goto onError;
while (1) {
while (1) {
...
@@ -6428,7 +6434,8 @@ PyUnicode_DecodeASCII(const char *s,
...
@@ -6428,7 +6434,8 @@ PyUnicode_DecodeASCII(const char *s,
return get_latin1_char((unsigned char)s[0]);
return get_latin1_char((unsigned char)s[0]);
_PyUnicodeWriter_Init(&writer);
_PyUnicodeWriter_Init(&writer);
if (_PyUnicodeWriter_Prepare(&writer, size, 127) < 0)
writer.min_length = size;
if (_PyUnicodeWriter_Prepare(&writer, writer.min_length, 127) < 0)
return NULL;
return NULL;
e = s + size;
e = s + size;
...
@@ -7279,7 +7286,8 @@ PyUnicode_DecodeCharmap(const char *s,
...
@@ -7279,7 +7286,8 @@ PyUnicode_DecodeCharmap(const char *s,
if (size == 0)
if (size == 0)
_Py_RETURN_UNICODE_EMPTY();
_Py_RETURN_UNICODE_EMPTY();
_PyUnicodeWriter_Init(&writer);
_PyUnicodeWriter_Init(&writer);
if (_PyUnicodeWriter_Prepare(&writer, size, 127) == -1)
writer.min_length = size;
if (_PyUnicodeWriter_Prepare(&writer, writer.min_length, 127) == -1)
goto onError;
goto onError;
e = s + size;
e = s + size;
...
...
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