Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Bug 1618915 - Fix UBSAN issue in ssl_ParseSessionTicket r=jcj,bbeurdo…
…uche

Differential Revision: https://phabricator.services.mozilla.com/D66130

--HG--
extra : moz-landing-system : lando
  • Loading branch information
Kevin Jacobs committed Mar 10, 2020
1 parent 9d0be6f commit 6aa30e6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/ssl/ssl3exthandle.c
Expand Up @@ -1034,7 +1034,9 @@ ssl_ParseSessionTicket(sslSocket *ss, const SECItem *decryptedTicket,
PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
return SECFailure;
}
parsedTicket->timestamp = (PRTime)temp << 32;

/* Cast to avoid undefined behavior if the top bit is set. */
parsedTicket->timestamp = (PRTime)((PRUint64)temp << 32);
rv = ssl3_ExtConsumeHandshakeNumber(ss, &temp, 4, &buffer, &len);
if (rv != SECSuccess) {
PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
Expand Down

0 comments on commit 6aa30e6

Please sign in to comment.