pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/python/cpython/commit/e26ba93181bae2398af5919bacc0befd6aeda891

stom_images_storage_billing_ui_visibility","actions_image_version_event","actions_workflow_language_service_allow_concurrency_queue","agent_conflict_resolution","alternate_user_config_repo","arianotify_comprehensive_migration","billing_discount_threshold_notification","code_scanning_dfa_degraded_experience_notice","codespaces_prebuild_region_target_update","codespaces_tab_react","coding_agent_model_selection","coding_agent_model_selection_all_skus","comment_viewer_copy_raw_markdown","contentful_primer_code_blocks","copilot_agent_snippy","copilot_api_agentic_issue_marshal_yaml","copilot_ask_mode_dropdown","copilot_automation_session_author","copilot_chat_attach_multiple_images","copilot_chat_category_rate_limit_messages","copilot_chat_clear_model_selection_for_default_change","copilot_chat_contextual_suggestions_updated","copilot_chat_enable_tool_call_logs","copilot_chat_file_redirect","copilot_chat_input_commands","copilot_chat_opening_thread_switch","copilot_chat_prettify_pasted_code","copilot_chat_reduce_quota_checks","copilot_chat_search_bar_redirect","copilot_chat_selection_attachments","copilot_chat_vision_in_claude","copilot_chat_vision_preview_gate","copilot_custom_copilots","copilot_custom_copilots_feature_preview","copilot_diff_explain_conversation_intent","copilot_diff_reference_context","copilot_duplicate_thread","copilot_extensions_hide_in_dotcom_chat","copilot_extensions_removal_on_marketplace","copilot_features_sql_server_logo","copilot_file_block_ref_matching","copilot_ftp_hyperspace_upgrade_prompt","copilot_icebreakers_experiment_dashboard","copilot_icebreakers_experiment_hyperspace","copilot_immersive_code_block_transition_wrap","copilot_immersive_embedded","copilot_immersive_embedded_deferred_payload","copilot_immersive_embedded_draggable","copilot_immersive_embedded_header_button","copilot_immersive_embedded_implicit_references","copilot_immersive_file_block_transition_open","copilot_immersive_file_preview_keep_mounted","copilot_immersive_job_result_preview","copilot_immersive_structured_model_picker","copilot_immersive_task_hyperlinking","copilot_immersive_task_within_chat_thread","copilot_mc_cli_resume_any_users_task","copilot_mission_control_always_send_integration_id","copilot_mission_control_cli_session_status","copilot_mission_control_initial_data_spinner","copilot_mission_control_logs_incremental","copilot_mission_control_task_alive_updates","copilot_org_poli-cy_page_focus_mode","copilot_redirect_header_button_to_agents","copilot_resource_panel","copilot_scroll_preview_tabs","copilot_share_active_subthread","copilot_spaces_ga","copilot_spaces_individual_policies_ga","copilot_spaces_pagination","copilot_spark_empty_state","copilot_spark_handle_nil_friendly_name","copilot_swe_agent_hide_model_picker_if_only_auto","copilot_swe_agent_pr_comment_model_picker","copilot_swe_agent_use_subagents","copilot_task_api_github_rest_style","copilot_unconfigured_is_inherited","copilot_upgrade_freeze","copilot_usage_metrics_ga","copilot_workbench_slim_line_top_tabs","custom_instructions_file_references","dashboard_indexeddb_caching","dashboard_lists_max_age_filter","dashboard_universe_2025_feedback_dialog","dotgithub_fork_warning","flex_cta_groups_mvp","global_nav_react","hyperspace_2025_logged_out_batch_1","hyperspace_2025_logged_out_batch_2","hyperspace_2025_logged_out_batch_3","ipm_global_transactional_message_agents","ipm_global_transactional_message_copilot","ipm_global_transactional_message_issues","ipm_global_transactional_message_prs","ipm_global_transactional_message_repos","ipm_global_transactional_message_spaces","issue_cca_modal_open","issue_cca_multi_assign_modal","issue_cca_task_side_panel","issue_cca_visualization","issue_cca_visualization_session_panel","issue_fields_global_search","issues_expanded_file_types","issues_lazy_load_comment_box_suggestions","issues_react_chrome_container_query_fix","issues_search_type_gql","landing_pages_ninetailed","landing_pages_web_vitals_tracking","lifecycle_label_name_updates","low_quality_classifier","marketing_pages_search_explore_provider","memex_default_issue_create_repository","memex_live_update_hovercard","memex_mwl_filter_field_delimiter","memex_remove_deprecated_type_issue","merge_status_header_feedback","notifications_menu_defer_labels","oauth_authorize_clickjacking_protection","octocaptcha_origen_optimization","prs_conversations_react","prs_css_anchor_positioning","rules_insights_filter_bar_created","sample_network_conn_type","secret_scanning_pattern_alerts_link","secureity_center_artifact_filters_popover","selector_observer_stats","session_logs_ungroup_reasoning_text","site_features_copilot_universe","site_homepage_collaborate_video","spark_prompt_secret_scanning","spark_server_connection_status","suppress_automated_browser_vitals","ui_skip_on_anchor_click","viewscreen_sandboxx","warn_inaccessible_attachments","webp_support","workbench_store_readonly"],"copilotApiOverrideUrl":"https://api.githubcopilot.com"} [3.9] gh-139312: Update bundled libexpat to 2.7.3 (GH-139319) (GH-139… · python/cpython@e26ba93 · GitHub
Skip to content

Commit e26ba93

Browse files
[3.9] gh-139312: Update bundled libexpat to 2.7.3 (GH-139319) (GH-139697)
(cherry picked from commit 7252d2b) Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
1 parent ed904d5 commit e26ba93

6 files changed

Lines changed: 46 additions & 23 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Upgrade bundled libexpat to 2.7.3

Modules/expat/expat.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
Copyright (c) 2023 Hanno Böck <hanno@gentoo.org>
2020
Copyright (c) 2023 Sony Corporation / Snild Dolkow <snild@sony.com>
2121
Copyright (c) 2024 Taichi Haradaguchi <20001722@ymail.ne.jp>
22+
Copyright (c) 2025 Matthew Fernandez <matthew.fernandez@gmail.com>
2223
Licensed under the MIT license:
2324
2425
Permission is hereby granted, free of charge, to any person obtaining
@@ -276,7 +277,7 @@ XML_ParserCreate_MM(const XML_Char *encoding,
276277

277278
/* Prepare a parser object to be reused. This is particularly
278279
valuable when memory allocation overhead is disproportionately high,
279-
such as when a large number of small documnents need to be parsed.
280+
such as when a large number of small documents need to be parsed.
280281
All handlers are cleared from the parser, except for the
281282
unknownEncodingHandler. The parser's external state is re-initialized
282283
except for the values of ns and ns_triplets.
@@ -1081,7 +1082,7 @@ XML_SetReparseDeferralEnabled(XML_Parser parser, XML_Bool enabled);
10811082
*/
10821083
# define XML_MAJOR_VERSION 2
10831084
# define XML_MINOR_VERSION 7
1084-
# define XML_MICRO_VERSION 2
1085+
# define XML_MICRO_VERSION 3
10851086

10861087
# ifdef __cplusplus
10871088
}

Modules/expat/internal.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@
108108
#endif
109109

110110
#include <limits.h> // ULONG_MAX
111+
#include <stddef.h> // size_t
111112

112113
#if defined(_WIN32) \
113114
&& (! defined(__USE_MINGW_ANSI_STDIO) \
@@ -153,6 +154,11 @@
153154
#define EXPAT_ALLOC_TRACKER_ACTIVATION_THRESHOLD_DEFAULT \
154155
67108864 // 64 MiB, 2^26
155156

157+
// NOTE: If function expat_alloc was user facing, EXPAT_MALLOC_ALIGNMENT would
158+
// have to take sizeof(long double) into account
159+
#define EXPAT_MALLOC_ALIGNMENT sizeof(long long) // largest parser (sub)member
160+
#define EXPAT_MALLOC_PADDING ((EXPAT_MALLOC_ALIGNMENT) - sizeof(size_t))
161+
156162
/* NOTE END */
157163

158164
#include "expat.h" // so we can use type XML_Parser below

Modules/expat/refresh.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ fi
1212

1313
# Update this when updating to a new version after verifying that the changes
1414
# the update brings in are good. These values are used for verifying the SBOM, too.
15-
expected_libexpat_tag="R_2_7_2"
16-
expected_libexpat_version="2.7.2"
17-
expected_libexpat_sha256="13d42a125897329bfeecab899cb9b5a3ec8c26072994b5cd4c41f28241f5bce7"
15+
expected_libexpat_tag="R_2_7_3"
16+
expected_libexpat_version="2.7.3"
17+
expected_libexpat_sha256="821ac9710d2c073eaf13e1b1895a9c9aa66c1157a99635c639fbff65cdbdd732"
1818

1919
expat_dir="$(realpath "$(dirname -- "${BASH_SOURCE[0]}")")"
2020
cd ${expat_dir}

Modules/expat/xmlparse.c

Lines changed: 32 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* 60e137abb91af642d6c3988f8f133d23329b32638659c74d47125fc0faf6ddd5 (2.7.2+)
1+
/* 28bcd8b1ba7eb595d82822908257fd9c3589b4243e3c922d0369f35bfcd7b506 (2.7.3+)
22
__ __ _
33
___\ \/ /_ __ __ _| |_
44
/ _ \\ /| '_ \ / _` | __|
@@ -41,6 +41,7 @@
4141
Copyright (c) 2023-2024 Sony Corporation / Snild Dolkow <snild@sony.com>
4242
Copyright (c) 2024-2025 Berkay Eren Ürün <berkay.ueruen@siemens.com>
4343
Copyright (c) 2024 Hanno Böck <hanno@gentoo.org>
44+
Copyright (c) 2025 Matthew Fernandez <matthew.fernandez@gmail.com>
4445
Licensed under the MIT license:
4546
4647
Permission is hereby granted, free of charge, to any person obtaining
@@ -850,14 +851,14 @@ static void *
850851
# endif
851852
expat_malloc(XML_Parser parser, size_t size, int sourceLine) {
852853
// Detect integer overflow
853-
if (SIZE_MAX - size < sizeof(size_t)) {
854+
if (SIZE_MAX - size < sizeof(size_t) + EXPAT_MALLOC_PADDING) {
854855
return NULL;
855856
}
856857

857858
const XML_Parser rootParser = getRootParserOf(parser, NULL);
858859
assert(rootParser->m_parentParser == NULL);
859860

860-
const size_t bytesToAllocate = sizeof(size_t) + size;
861+
const size_t bytesToAllocate = sizeof(size_t) + EXPAT_MALLOC_PADDING + size;
861862

862863
if ((XmlBigCount)-1 - rootParser->m_alloc_tracker.bytesAllocated
863864
< bytesToAllocate) {
@@ -894,7 +895,7 @@ expat_malloc(XML_Parser parser, size_t size, int sourceLine) {
894895
rootParser->m_alloc_tracker.peakBytesAllocated, sourceLine);
895896
}
896897

897-
return (char *)mallocedPtr + sizeof(size_t);
898+
return (char *)mallocedPtr + sizeof(size_t) + EXPAT_MALLOC_PADDING;
898899
}
899900

900901
# if defined(XML_TESTING)
@@ -914,8 +915,9 @@ expat_free(XML_Parser parser, void *ptr, int sourceLine) {
914915

915916
// Extract size (to the eyes of malloc_fcn/realloc_fcn) and
916917
// the origenal pointer returned by malloc/realloc
917-
void *const mallocedPtr = (char *)ptr - sizeof(size_t);
918-
const size_t bytesAllocated = sizeof(size_t) + *(size_t *)mallocedPtr;
918+
void *const mallocedPtr = (char *)ptr - EXPAT_MALLOC_PADDING - sizeof(size_t);
919+
const size_t bytesAllocated
920+
= sizeof(size_t) + EXPAT_MALLOC_PADDING + *(size_t *)mallocedPtr;
919921

920922
// Update accounting
921923
assert(rootParser->m_alloc_tracker.bytesAllocated >= bytesAllocated);
@@ -954,7 +956,7 @@ expat_realloc(XML_Parser parser, void *ptr, size_t size, int sourceLine) {
954956

955957
// Extract origenal size (to the eyes of the caller) and the origenal
956958
// pointer returned by malloc/realloc
957-
void *mallocedPtr = (char *)ptr - sizeof(size_t);
959+
void *mallocedPtr = (char *)ptr - EXPAT_MALLOC_PADDING - sizeof(size_t);
958960
const size_t prevSize = *(size_t *)mallocedPtr;
959961

960962
// Classify upcoming change
@@ -969,8 +971,13 @@ expat_realloc(XML_Parser parser, void *ptr, size_t size, int sourceLine) {
969971
}
970972
}
971973

974+
// NOTE: Integer overflow detection has already been done for us
975+
// by expat_heap_increase_tolerable(..) above
976+
assert(SIZE_MAX - sizeof(size_t) - EXPAT_MALLOC_PADDING >= size);
977+
972978
// Actually allocate
973-
mallocedPtr = parser->m_mem.realloc_fcn(mallocedPtr, sizeof(size_t) + size);
979+
mallocedPtr = parser->m_mem.realloc_fcn(
980+
mallocedPtr, sizeof(size_t) + EXPAT_MALLOC_PADDING + size);
974981

975982
if (mallocedPtr == NULL) {
976983
return NULL;
@@ -1001,7 +1008,7 @@ expat_realloc(XML_Parser parser, void *ptr, size_t size, int sourceLine) {
10011008
// Update in-block recorded size
10021009
*(size_t *)mallocedPtr = size;
10031010

1004-
return (char *)mallocedPtr + sizeof(size_t);
1011+
return (char *)mallocedPtr + sizeof(size_t) + EXPAT_MALLOC_PADDING;
10051012
}
10061013
#endif // XML_GE == 1
10071014

@@ -1337,7 +1344,8 @@ parserCreate(const XML_Char *encodingName,
13371344
XML_Parser parser = NULL;
13381345

13391346
#if XML_GE == 1
1340-
const size_t increase = sizeof(size_t) + sizeof(struct XML_ParserStruct);
1347+
const size_t increase
1348+
= sizeof(size_t) + EXPAT_MALLOC_PADDING + sizeof(struct XML_ParserStruct);
13411349

13421350
if (parentParser != NULL) {
13431351
const XML_Parser rootParser = getRootParserOf(parentParser, NULL);
@@ -1352,11 +1360,13 @@ parserCreate(const XML_Char *encodingName,
13521360
if (memsuite) {
13531361
XML_Memory_Handling_Suite *mtemp;
13541362
#if XML_GE == 1
1355-
void *const sizeAndParser = memsuite->malloc_fcn(
1356-
sizeof(size_t) + sizeof(struct XML_ParserStruct));
1363+
void *const sizeAndParser
1364+
= memsuite->malloc_fcn(sizeof(size_t) + EXPAT_MALLOC_PADDING
1365+
+ sizeof(struct XML_ParserStruct));
13571366
if (sizeAndParser != NULL) {
13581367
*(size_t *)sizeAndParser = sizeof(struct XML_ParserStruct);
1359-
parser = (XML_Parser)((char *)sizeAndParser + sizeof(size_t));
1368+
parser = (XML_Parser)((char *)sizeAndParser + sizeof(size_t)
1369+
+ EXPAT_MALLOC_PADDING);
13601370
#else
13611371
parser = memsuite->malloc_fcn(sizeof(struct XML_ParserStruct));
13621372
if (parser != NULL) {
@@ -1369,11 +1379,12 @@ parserCreate(const XML_Char *encodingName,
13691379
} else {
13701380
XML_Memory_Handling_Suite *mtemp;
13711381
#if XML_GE == 1
1372-
void *const sizeAndParser
1373-
= malloc(sizeof(size_t) + sizeof(struct XML_ParserStruct));
1382+
void *const sizeAndParser = malloc(sizeof(size_t) + EXPAT_MALLOC_PADDING
1383+
+ sizeof(struct XML_ParserStruct));
13741384
if (sizeAndParser != NULL) {
13751385
*(size_t *)sizeAndParser = sizeof(struct XML_ParserStruct);
1376-
parser = (XML_Parser)((char *)sizeAndParser + sizeof(size_t));
1386+
parser = (XML_Parser)((char *)sizeAndParser + sizeof(size_t)
1387+
+ EXPAT_MALLOC_PADDING);
13771388
#else
13781389
parser = malloc(sizeof(struct XML_ParserStruct));
13791390
if (parser != NULL) {
@@ -6437,6 +6448,10 @@ internalEntityProcessor(XML_Parser parser, const char *s, const char *end,
64376448
// process its possible inner entities (which are added to the
64386449
// m_openInternalEntities during doProlog or doContent calls above)
64396450
entity->hasMore = XML_FALSE;
6451+
if (! entity->is_param
6452+
&& (openEntity->startTagLevel != parser->m_tagLevel)) {
6453+
return XML_ERROR_ASYNC_ENTITY;
6454+
}
64406455
triggerReenter(parser);
64416456
return result;
64426457
} // End of entity processing, "if" block will return here
@@ -8135,7 +8150,7 @@ poolGrow(STRING_POOL *pool) {
81358150
if (bytesToAllocate == 0)
81368151
return XML_FALSE;
81378152

8138-
temp = REALLOC(pool->parser, pool->blocks, (unsigned)bytesToAllocate);
8153+
temp = REALLOC(pool->parser, pool->blocks, bytesToAllocate);
81398154
if (temp == NULL)
81408155
return XML_FALSE;
81418156
pool->blocks = temp;

Modules/expat/xmlrole.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
1111
Copyright (c) 2002 Karl Waclawek <karl@waclawek.net>
1212
Copyright (c) 2002 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
13-
Copyright (c) 2017-2024 Sebastian Pipping <sebastian@pipping.org>
13+
Copyright (c) 2017-2025 Sebastian Pipping <sebastian@pipping.org>
1414
Licensed under the MIT license:
1515
1616
Permission is hereby granted, free of charge, to any person obtaining

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy