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
d81ad0df
Kaydet (Commit)
d81ad0df
authored
Agu 14, 2016
tarafından
Benjamin Peterson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
check for overflow in join_append_data (closes #27758)
Reported by Thomas E. Hybel
üst
04a53853
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
4 deletions
+22
-4
NEWS
Misc/NEWS
+3
-0
_csv.c
Modules/_csv.c
+19
-4
No files found.
Misc/NEWS
Dosyayı görüntüle @
d81ad0df
...
...
@@ -29,6 +29,9 @@ Core and Builtins
Library
-------
- Issue #27758: Fix possible integer overflow in the _csv module for large record
lengths.
- Issue #23369: Fixed possible integer overflow in
_json.encode_basestring_ascii.
...
...
Modules/_csv.c
Dosyayı görüntüle @
d81ad0df
...
...
@@ -985,11 +985,19 @@ join_append_data(WriterObj *self, char *field, int quote_empty,
int
i
,
rec_len
;
char
*
lineterm
;
#define ADDCH(c) \
#define INCLEN \
do {\
if (!copy_phase && rec_len == INT_MAX) { \
goto overflow; \
} \
rec_len++; \
} while(0)
#define ADDCH(c) \
do {\
if (copy_phase) \
self->rec[rec_len] = c;\
rec_len++
;\
INCLEN
;\
} while(0)
lineterm
=
PyString_AsString
(
dialect
->
lineterminator
);
...
...
@@ -1059,11 +1067,18 @@ join_append_data(WriterObj *self, char *field, int quote_empty,
if
(
*
quoted
)
{
if
(
copy_phase
)
ADDCH
(
dialect
->
quotechar
);
else
rec_len
+=
2
;
else
{
INCLEN
;
/* starting quote */
INCLEN
;
/* ending quote */
}
}
return
rec_len
;
overflow:
PyErr_NoMemory
();
return
-
1
;
#undef ADDCH
#undef INCLEN
}
static
int
...
...
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