Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix integer overflow in TDSWriter.writeString() #1531

Merged
merged 1 commit into from
Mar 25, 2021

Conversation

micheljung
Copy link
Contributor

Fixes GH-1530

@peterbae peterbae added this to Under Investigation in MSSQL JDBC Mar 9, 2021
@peterbae
Copy link
Contributor

peterbae commented Mar 9, 2021

@micheljung could you add a test case to show that this fix will solve the issue?

@micheljung
Copy link
Contributor Author

@peterbae I can but this will require generating a string that uses 1GiB of memory. Is that something you're ok with having in your unit tests?

@peterbae
Copy link
Contributor

peterbae commented Mar 9, 2021

I was hoping we could host the file somewhere, since the standard procedure for pushing a fix to our repository requires some form of testing (to make sure the fix is intended). However, I think this fix is pretty straightforward, so I think we don't need a test case for this one. We will review and merge this soon.

@micheljung
Copy link
Contributor Author

The file wouldn't need to be hosted, the string can be generated. My question is whether you want a unit test that consumes 1 GiB of heap just for a single string :)

@peterbae
Copy link
Contributor

No, I think it would be ok without the test this time.

@lilgreenbird
Copy link
Member

/azp run Microsoft.mssql-jdbc.macOS

@azure-pipelines
Copy link

No pipelines are associated with this pull request.

@peterbae peterbae added this to the 9.3.0 milestone Mar 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
MSSQL JDBC
  
Closed/Merged PRs
Development

Successfully merging this pull request may close these issues.

Writing strings longer than 2^30-1 characters results in endless loop
5 participants