| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 1cd2417 commit 4b20ed9
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1104,6 +1104,8 @@ join_append_lineterminator(WriterObj *self) | |||
| 1104 | 1104 | char *terminator; | |
| 1105 | 1105 | ||
| 1106 | 1106 | terminator_len = PyString_Size(self->dialect->lineterminator); | |
| 1107 | + if (terminator_len == -1) | ||
| 1108 | + return 0; | ||
| 1107 | 1109 | ||
| 1108 | 1110 | /* grow record buffer if necessary */ | |
| 1109 | 1111 | if (!join_check_rec_size(self, self->rec_len + terminator_len)) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -327,8 +327,10 @@ element_new(PyObject* tag, PyObject* attrib) | |||
| 327 | 327 | ||
| 328 | 328 | if (attrib != Py_None) { | |
| 329 | 329 | ||
| 330 | - if (element_new_extra(self, attrib) < 0) | ||
| 330 | + if (element_new_extra(self, attrib) < 0) { | ||
| 331 | + PyObject_Del(self); | ||
| 331 | 332 | return NULL; | |
| 333 | + } | ||
| 332 | 334 | ||
| 333 | 335 | self->extra->length = 0; | |
| 334 | 336 | self->extra->allocated = STATIC_CHILDREN; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -183,9 +183,9 @@ newPySSLObject(PySocketSockObject *Sock, char *key_file, char *cert_file) | |||
| 183 | 183 | int sockstate; | |
| 184 | 184 | ||
| 185 | 185 | self = PyObject_New(PySSLObject, &PySSL_Type); /* Create new object */ | |
| 186 | - if (self == NULL){ | ||
| 187 | - errstr = "newPySSLObject error"; | ||
| 188 | - goto fail; | ||
| 186 | + if (self == NULL) { | ||
| 187 | + PyErr_SetString(PySSLErrorObject, "newPySSLObject error"); | ||
| 188 | + return NULL; | ||
| 189 | 189 | } | |
| 190 | 190 | memset(self->server, '\0', sizeof(char) * X509_NAME_MAXLEN); | |
| 191 | 191 | memset(self->issuer, '\0', sizeof(char) * X509_NAME_MAXLEN); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -66,8 +66,7 @@ long_normalize(register PyLongObject *v) | |||
| 66 | 66 | PyLongObject * | |
| 67 | 67 | _PyLong_New(Py_ssize_t size) | |
| 68 | 68 | { | |
| 69 | - if (size > INT_MAX) { | ||
| 70 | - /* XXX: Fix this check when ob_size becomes ssize_t */ | ||
| 69 | + if (size > PY_SSIZE_T_MAX) { | ||
| 71 | 70 | PyErr_NoMemory(); | |
| 72 | 71 | return NULL; | |
| 73 | 72 | } | |
@@ -1580,9 +1579,10 @@ x_divrem(PyLongObject *v1, PyLongObject *w1, PyLongObject **prem) | |||
| 1580 | 1579 | assert(size_w == ABS(w->ob_size)); /* That's how d was calculated */ | |
| 1581 | 1580 | ||
| 1582 | 1581 | size_v = ABS(v->ob_size); | |
| 1583 | - a = _PyLong_New(size_v - size_w + 1); | ||
| 1582 | + k = size_v - size_w; | ||
| 1583 | + a = _PyLong_New(k + 1); | ||
| 1584 | 1584 | ||
| 1585 | - for (j = size_v, k = a->ob_size-1; a != NULL && k >= 0; --j, --k) { | ||
| 1585 | + for (j = size_v; a != NULL && k >= 0; --j, --k) { | ||
| 1586 | 1586 | digit vj = (j >= size_v) ? 0 : v->ob_digit[j]; | |
| 1587 | 1587 | twodigits q; | |
| 1588 | 1588 | stwodigits carry = 0; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments