diff options
author | Eli Bendersky <eliben@gmail.com> | 2013-05-25 12:27:10 (GMT) |
---|---|---|
committer | Eli Bendersky <eliben@gmail.com> | 2013-05-25 12:27:10 (GMT) |
commit | 7b3022f24f4bb8c64d02e103de3168e96729bdc2 (patch) | |
tree | 1d027a6e109d195fe7c6a1b3662ea4618c6fcb28 /Include | |
parent | 19fef69b752d5a1e836ba5b552a8e68592503852 (diff) | |
parent | 6dc32b34ddfba0ddb990cbbb77cf8803879d20f9 (diff) | |
download | cpython-7b3022f24f4bb8c64d02e103de3168e96729bdc2.zip cpython-7b3022f24f4bb8c64d02e103de3168e96729bdc2.tar.gz cpython-7b3022f24f4bb8c64d02e103de3168e96729bdc2.tar.bz2 |
Issue #13612: handle unknown encodings without a buffer overflow.
This affects pyexpat and _elementtree. PyExpat_CAPI now exposes a new
function - DefaultUnknownEncodingHandler.
Based on a patch by Serhiy Storchaka.
Diffstat (limited to 'Include')
-rw-r--r-- | Include/pyexpat.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Include/pyexpat.h b/Include/pyexpat.h index 8a79974..44259bf 100644 --- a/Include/pyexpat.h +++ b/Include/pyexpat.h @@ -6,7 +6,7 @@ #define PyExpat_CAPI_MAGIC "pyexpat.expat_CAPI 1.0" #define PyExpat_CAPSULE_NAME "pyexpat.expat_CAPI" -struct PyExpat_CAPI +struct PyExpat_CAPI { char* magic; /* set to PyExpat_CAPI_MAGIC */ int size; /* set to sizeof(struct PyExpat_CAPI) */ @@ -46,6 +46,8 @@ struct PyExpat_CAPI void (*SetStartDoctypeDeclHandler)(XML_Parser parser, XML_StartDoctypeDeclHandler start); enum XML_Status (*SetEncoding)(XML_Parser parser, const XML_Char *encoding); + int (*DefaultUnknownEncodingHandler)( + void *encodingHandlerData, const XML_Char *name, XML_Encoding *info); /* always add new stuff to the end! */ }; |