Show More
@@ -1092,15 +1092,15 b' static int nt_delete_node(indexObject *s' | |||
|
1092 | 1092 | static int nt_init(indexObject *self) |
|
1093 | 1093 | { |
|
1094 | 1094 | if (self->nt == NULL) { |
|
1095 | if ((size_t)self->raw_length > INT_MAX / sizeof(nodetreenode)) { | |
|
1096 | PyErr_SetString(PyExc_ValueError, "overflow in nt_init"); | |
|
1097 | return -1; | |
|
1098 | } | |
|
1095 | 1099 | self->nt = PyMem_Malloc(sizeof(nodetree)); |
|
1096 | 1100 | if (self->nt == NULL) { |
|
1097 | 1101 | PyErr_NoMemory(); |
|
1098 | 1102 | return -1; |
|
1099 | 1103 | } |
|
1100 | if ((size_t)self->raw_length > INT_MAX / sizeof(nodetreenode)) { | |
|
1101 | PyErr_SetString(PyExc_ValueError, "overflow in nt_init"); | |
|
1102 | return -1; | |
|
1103 | } | |
|
1104 | 1104 | self->nt->capacity = self->raw_length < 4 |
|
1105 | 1105 | ? 4 : (int)self->raw_length / 2; |
|
1106 | 1106 |
General Comments 0
You need to be logged in to leave comments.
Login now