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

Unified Diff: net/third_party/nss/ssl/sslsock.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
« net/third_party/nss/ssl/ssl3ext.c ('K') | « net/third_party/nss/ssl/ssl3ext.c ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/third_party/nss/ssl/sslsock.c
===================================================================
--- net/third_party/nss/ssl/sslsock.c (revision 125777)
+++ net/third_party/nss/ssl/sslsock.c (working copy)
@@ -1344,7 +1344,7 @@
return SECSuccess;
}
-/* NextProtoStandardCallback is set as an NPN callback for the case when
+/* ssl_NextProtoNegoCallback is set as an NPN callback for the case when
* SSL_SetNextProtoNego is used.
*/
static SECStatus
@@ -1390,12 +1390,12 @@
result = ss->opt.nextProtoNego.data;
found:
- *protoOutLen = result[0];
if (protoMaxLen < result[0]) {
PORT_SetError(SEC_ERROR_OUTPUT_LEN);
return SECFailure;
}
memcpy(protoOut, result + 1, result[0]);
+ *protoOutLen = result[0];
return SECSuccess;
}
@@ -1449,13 +1449,12 @@
if (ss->ssl3.nextProtoState != SSL_NEXT_PROTO_NO_SUPPORT &&
ss->ssl3.nextProto.data) {
- *bufLen = ss->ssl3.nextProto.len;
- if (*bufLen > bufLenMax) {
+ if (ss->ssl3.nextProto.len > bufLenMax) {
PORT_SetError(SEC_ERROR_OUTPUT_LEN);
- *bufLen = 0;
return SECFailure;
}
PORT_Memcpy(buf, ss->ssl3.nextProto.data, ss->ssl3.nextProto.len);
+ *bufLen = ss->ssl3.nextProto.len;
} else {
*bufLen = 0;
}
« net/third_party/nss/ssl/ssl3ext.c ('K') | « net/third_party/nss/ssl/ssl3ext.c ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698