Skip to content
This repository was archived by the owner on May 12, 2026. It is now read-only.

Fixing an Integer Overflow Issue#121

Merged
lesv merged 4 commits into
googleapis:masterfrom
hiranya911:master
Aug 28, 2017
Merged

Fixing an Integer Overflow Issue#121
lesv merged 4 commits into
googleapis:masterfrom
hiranya911:master

Conversation

@hiranya911

Copy link
Copy Markdown
Contributor

If the token server responds with a large expires_in value to the token refresh request, the ServiceAccountCredential class runs into an integer overflow. I've added more information at #120.

This patch fixes the issue, and provides a test case (test case fails without the fix). This is not a critical issue, as we can expect most token servers to be well behaved. But it would be nice if the credentials were able to handle the case where the server responds with a large expires_in value.

@lesv lesv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@garrettjonesgoogle FYI

One Q, then I can approve. (I read the comment, but I'm not sure it makes sense.

assertEquals(tokenString, accessToken.getTokenValue());
assertEquals(3600 * 1000L, accessToken.getExpirationTimeMillis().longValue());

// Test for large expires_in values (should not overflow).

This comment was marked as spam.

This comment was marked as spam.

@lesv lesv merged commit 3c5fabd into googleapis:master Aug 28, 2017
@lesv

lesv commented Aug 28, 2017

Copy link
Copy Markdown
Contributor

@garrettjonesgoogle I've merged, but can revert if you wish.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants