Skip to content

Increase buffer size used for GitHub token.#139

Merged
MikeFultonDev merged 2 commits intozopencommunity:mainfrom
redstar:knacke/fixtoken
Jan 25, 2023
Merged

Increase buffer size used for GitHub token.#139
MikeFultonDev merged 2 commits intozopencommunity:mainfrom
redstar:knacke/fixtoken

Conversation

@redstar
Copy link
Copy Markdown
Contributor

@redstar redstar commented Jan 25, 2023

According to the GitHub blog a GitHub token can be aup to 255 characters in length. The current temporary buffer has size 80, which is too small.
This PR changes the size to 280 (255 for the token, 20 for Authorization:Bearer, and a couple of spare bytes).

According to https://github.blog/changelog/2021-03-31-authentication-token-format-updates-are-generally-available/
a GitHub token can be aup to 255 characters in length. The current
temporary buffer has size 80, which is too small.
This PR changes the size to 280 (255 for the token, 20 for
Authorization:Bearer, and a couple of spare bytes.
Copy link
Copy Markdown
Collaborator

@MikeFultonDev MikeFultonDev left a comment

Choose a reason for hiding this comment

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

can you either add a comment on why the magic 280 or alternately do the math in the array, e.g.
char buf[255+...] with a comment (and ideally a pointer to the github link).

@redstar
Copy link
Copy Markdown
Contributor Author

redstar commented Jan 25, 2023

Done.

Copy link
Copy Markdown
Collaborator

@MikeFultonDev MikeFultonDev left a comment

Choose a reason for hiding this comment

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

thanks!

@MikeFultonDev MikeFultonDev merged commit 8319148 into zopencommunity:main Jan 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants