Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(2257)

Side by Side Diff: Include/object.h

Issue 13703: Hash collision security issue
Patch Set: Created 1 year, 3 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Doc/using/cmdline.rst ('k') | Include/pydebug.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #ifndef Py_OBJECT_H 1 #ifndef Py_OBJECT_H
2 #define Py_OBJECT_H 2 #define Py_OBJECT_H
3 #ifdef __cplusplus 3 #ifdef __cplusplus
4 extern "C" { 4 extern "C" {
5 #endif 5 #endif
6 6
7 7
8 /* Object and type object interface */ 8 /* Object and type object interface */
9 9
10 /* 10 /*
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 PyAPI_FUNC(PyObject *) PyObject_Dir(PyObject *); 465 PyAPI_FUNC(PyObject *) PyObject_Dir(PyObject *);
466 466
467 467
468 /* Helpers for printing recursive container types */ 468 /* Helpers for printing recursive container types */
469 PyAPI_FUNC(int) Py_ReprEnter(PyObject *); 469 PyAPI_FUNC(int) Py_ReprEnter(PyObject *);
470 PyAPI_FUNC(void) Py_ReprLeave(PyObject *); 470 PyAPI_FUNC(void) Py_ReprLeave(PyObject *);
471 471
472 /* Helpers for hash functions */ 472 /* Helpers for hash functions */
473 PyAPI_FUNC(long) _Py_HashDouble(double); 473 PyAPI_FUNC(long) _Py_HashDouble(double);
474 PyAPI_FUNC(long) _Py_HashPointer(void*); 474 PyAPI_FUNC(long) _Py_HashPointer(void*);
475
476 typedef struct {
477 long prefix;
478 long suffix;
479 } _Py_HashSecret_t;
480 PyAPI_DATA(_Py_HashSecret_t) _Py_HashSecret;
475 481
476 /* Helper for passing objects to printf and the like */ 482 /* Helper for passing objects to printf and the like */
477 #define PyObject_REPR(obj) _PyUnicode_AsString(PyObject_Repr(obj)) 483 #define PyObject_REPR(obj) _PyUnicode_AsString(PyObject_Repr(obj))
478 484
479 /* Flag bits for printing: */ 485 /* Flag bits for printing: */
480 #define Py_PRINT_RAW 1 /* No string quotes etc. */ 486 #define Py_PRINT_RAW 1 /* No string quotes etc. */
481 487
482 /* 488 /*
483 `Type flags (tp_flags) 489 `Type flags (tp_flags)
484 490
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
865 if (_PyTrash_delete_later && _PyTrash_delete_nesting <= 0) \ 871 if (_PyTrash_delete_later && _PyTrash_delete_nesting <= 0) \
866 _PyTrash_destroy_chain(); \ 872 _PyTrash_destroy_chain(); \
867 } \ 873 } \
868 else \ 874 else \
869 _PyTrash_deposit_object((PyObject*)op); 875 _PyTrash_deposit_object((PyObject*)op);
870 876
871 #ifdef __cplusplus 877 #ifdef __cplusplus
872 } 878 }
873 #endif 879 #endif
874 #endif /* !Py_OBJECT_H */ 880 #endif /* !Py_OBJECT_H */
OLDNEW
« no previous file with comments | « Doc/using/cmdline.rst ('k') | Include/pydebug.h » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld cbc36f91f3f7