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

Fixed crash on non-existent port with version override #1357

Merged
merged 3 commits into from
Mar 6, 2024

Conversation

dforsten
Copy link
Contributor

Fixes this issue reported in the vcpkg project:
microsoft/vcpkg#36994

The "entry" function does not return an error but an empty RegistryEntry in some situations, needs to be checked for.

An alternative solution would be to refactor all registry implementations to never return an empty RegistryEntry, but an error instead.
That should be done in a separate issue after this fix is merged.

… error. We need to explicitly check if the returned registry entry is non-empty.
@ras0219-msft
Copy link
Contributor

Thank you for the fix, this looks great!

Could you also add an end-to-end test that verifies this behavior and prevents future regressions? It should hopefully be pretty straightforward to extend https://github.com/microsoft/vcpkg-tool/blob/main/azure-pipelines/end-to-end-tests-dir/registries.ps1 to cover this case.

@BillyONeal
Copy link
Member

I added such a test. I verified that the un-fixed product failed:

test failure evidence

@dforsten
Copy link
Contributor Author

dforsten commented Mar 2, 2024

@microsoft-github-policy-service agree

@BillyONeal BillyONeal merged commit 52b5cb7 into microsoft:main Mar 6, 2024
5 checks passed
@BillyONeal
Copy link
Member

Thanks again for your help!

@dforsten
Copy link
Contributor Author

dforsten commented Mar 6, 2024

Glad to be of help,
thanks for creating a great tool for the C++ community!

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.

3 participants