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

Delta Between Two Patch Sets: Modules/_ssl.c

Issue 18135: _ssl module: possible integer overflow for very long strings (+2^31 bytes)
Left Patch Set: Created 6 years, 7 months ago
Right Patch Set: Created 6 years, 7 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:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « Misc/NEWS ('k') | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 /* SSL socket module 1 /* SSL socket module
2 2
3 SSL support based on patches by Brian E Gallew and Laszlo Kovacs. 3 SSL support based on patches by Brian E Gallew and Laszlo Kovacs.
4 Re-worked a bit by Bill Janssen to add server-side support and 4 Re-worked a bit by Bill Janssen to add server-side support and
5 certificate decoding. Chris Stawarz contributed some non-blocking 5 certificate decoding. Chris Stawarz contributed some non-blocking
6 patches. 6 patches.
7 7
8 This module is imported by ssl.py. It should *not* be used 8 This module is imported by ssl.py. It should *not* be used
9 directly. 9 directly.
10 10
(...skipping 1273 matching lines...) Expand 10 before | Expand all | Expand 10 after
1284 PyErr_SetString(PySSLErrorObject, 1284 PyErr_SetString(PySSLErrorObject,
1285 "Underlying socket has been closed."); 1285 "Underlying socket has been closed.");
1286 goto error; 1286 goto error;
1287 } else if (sockstate == SOCKET_TOO_LARGE_FOR_SELECT) { 1287 } else if (sockstate == SOCKET_TOO_LARGE_FOR_SELECT) {
1288 PyErr_SetString(PySSLErrorObject, 1288 PyErr_SetString(PySSLErrorObject,
1289 "Underlying socket too large for select()."); 1289 "Underlying socket too large for select().");
1290 goto error; 1290 goto error;
1291 } 1291 }
1292 do { 1292 do {
1293 PySSL_BEGIN_ALLOW_THREADS 1293 PySSL_BEGIN_ALLOW_THREADS
1294 len = SSL_write(self->ssl, buf.buf, len); 1294 len = SSL_write(self->ssl, buf.buf, (int)buf.len);
AntoinePitrou 2013/06/23 20:49:31 len is never initialized?
1295 err = SSL_get_error(self->ssl, len); 1295 err = SSL_get_error(self->ssl, len);
1296 PySSL_END_ALLOW_THREADS 1296 PySSL_END_ALLOW_THREADS
1297 if (PyErr_CheckSignals()) { 1297 if (PyErr_CheckSignals()) {
1298 goto error; 1298 goto error;
1299 } 1299 }
1300 if (err == SSL_ERROR_WANT_READ) { 1300 if (err == SSL_ERROR_WANT_READ) {
1301 sockstate = check_socket_and_wait_for_timeout(sock, 0); 1301 sockstate = check_socket_and_wait_for_timeout(sock, 0);
1302 } else if (err == SSL_ERROR_WANT_WRITE) { 1302 } else if (err == SSL_ERROR_WANT_WRITE) {
1303 sockstate = check_socket_and_wait_for_timeout(sock, 1); 1303 sockstate = check_socket_and_wait_for_timeout(sock, 1);
1304 } else { 1304 } else {
(...skipping 1574 matching lines...) Expand 10 before | Expand all | Expand 10 after
2879 return NULL; 2879 return NULL;
2880 2880
2881 libver = OPENSSL_VERSION_NUMBER; 2881 libver = OPENSSL_VERSION_NUMBER;
2882 parse_openssl_version(libver, &major, &minor, &fix, &patch, &status); 2882 parse_openssl_version(libver, &major, &minor, &fix, &patch, &status);
2883 r = Py_BuildValue("IIIII", major, minor, fix, patch, status); 2883 r = Py_BuildValue("IIIII", major, minor, fix, patch, status);
2884 if (r == NULL || PyModule_AddObject(m, "_OPENSSL_API_VERSION", r)) 2884 if (r == NULL || PyModule_AddObject(m, "_OPENSSL_API_VERSION", r))
2885 return NULL; 2885 return NULL;
2886 2886
2887 return m; 2887 return m;
2888 } 2888 }
LEFTRIGHT
« Misc/NEWS ('k') | no next file » | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+