Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(647)

Unified Diff: net/third_party/nss/ssl/ssl3ext.c

Issue 9663034: Fix a buffer length bug and nits in the next protocol negotiation (NPN) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/third_party/nss/patches/nextprotocleanup.patch ('k') | net/third_party/nss/ssl/sslsock.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/third_party/nss/ssl/ssl3ext.c
===================================================================
--- net/third_party/nss/ssl/ssl3ext.c (revision 125777)
+++ net/third_party/nss/ssl/ssl3ext.c (working copy)
@@ -606,10 +606,7 @@
unsigned char resultBuffer[255];
SECItem result = { siBuffer, resultBuffer, 0 };
- if (ss->firstHsDone) {
wtc 2012/03/10 00:43:15 ss->firstHsDone cannot be true here. Line 650 bel
- PORT_SetError(SSL_ERROR_NEXT_PROTOCOL_DATA_INVALID);
- return SECFailure;
- }
+ PORT_Assert(!ss->firstHsDone);
rv = ssl3_ValidateNextProtoNego(data->data, data->len);
if (rv != SECSuccess)
@@ -621,6 +618,8 @@
*/
PORT_Assert(ss->nextProtoCallback != NULL);
if (!ss->nextProtoCallback) {
+ /* XXX Use a better error code. This is an application error, not an
+ * NSS bug. */
PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
return SECFailure;
}
@@ -631,7 +630,7 @@
return rv;
/* If the callback wrote more than allowed to |result| it has corrupted our
* stack. */
- if (result.len > sizeof result) {
+ if (result.len > sizeof resultBuffer) {
wtc 2012/03/10 00:43:15 This is the fix for the buffer length bug. We wil
PORT_SetError(SEC_ERROR_OUTPUT_LEN);
return SECFailure;
}
« no previous file with comments | « net/third_party/nss/patches/nextprotocleanup.patch ('k') | net/third_party/nss/ssl/sslsock.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698