A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/python/cpython/commit/64ea192b73e39e877d8b39ce6584fa580eb0e9b4 below:

prevent buffer overflow in get_data (closes #26171) · python/cpython@64ea192 · GitHub

File tree Expand file treeCollapse file tree 2 files changed

+8

-0

lines changed

Filter options

Expand file treeCollapse file tree 2 files changed

+8

-0

lines changed Original file line number Diff line number Diff line change

@@ -36,6 +36,9 @@ Core and Builtins

36 36

__str__, __trunc__, and __float__ returning instances of subclasses of

37 37

str, long, and float to subclasses of str, long, and float correspondingly.

38 38 39 +

- Issue #26171: Fix possible integer overflow and heap corruption in

40 +

zipimporter.get_data().

41 + 39 42

Library

40 43

-------

41 44 Original file line number Diff line number Diff line change

@@ -895,6 +895,11 @@ get_data(char *archive, PyObject *toc_entry)

895 895

PyMarshal_ReadShortFromFile(fp); /* local header size */

896 896

file_offset += l; /* Start of file data */

897 897 898 +

if (data_size > LONG_MAX - 1) {

899 +

fclose(fp);

900 +

PyErr_NoMemory();

901 +

return NULL;

902 +

}

898 903

raw_data = PyString_FromStringAndSize((char *)NULL, compress == 0 ?

899 904

data_size : data_size + 1);

900 905

if (raw_data == NULL) {

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4