Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/VcpkgPortOverlay/CreatePortOverlay.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,8 @@ if ($StampFile) {

try {
New-PortOverlay cpprestsdk -Version 2.10.18 -PortVersion 4
# stdext::checked_array_iterator was removed in VS2026 (MSVC 19.43); replace with plain pointers.
Add-LocalPatch cpprestsdk 'fix-msvc-checked-array-iterator.patch'
Comment on lines 563 to +565

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks like there is already a fix in the official port: microsoft/vcpkg#51750
Instead of applying our own patch, we could just update the version we use.

Suggested change
New-PortOverlay cpprestsdk -Version 2.10.18 -PortVersion 4
# stdext::checked_array_iterator was removed in VS2026 (MSVC 19.43); replace with plain pointers.
Add-LocalPatch cpprestsdk 'fix-msvc-checked-array-iterator.patch'
New-PortOverlay cpprestsdk -Version 2.10.19 -PortVersion 5

While looking this up, I learned that cpprestsdk is now delisted from vcpkg (microsoft/vcpkg#52130) because the repo was archived. So maybe we'll have to figure out something else to use at some point.

Add-LocalPatch cpprestsdk 'add-server-certificate-validation.patch'

New-PortOverlay detours -Version 4.0.1 -PortVersion 8
Expand Down
2 changes: 2 additions & 0 deletions src/VcpkgPortOverlay/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ We add support for certificate pinning.
Note that we use v2.10.18, which is not the latest.

Changes:
* Add patch file: `fix-msvc-checked-array-iterator.patch`
* `stdext::checked_array_iterator` was removed in VS2026 (MSVC 19.43). This patch replaces its usages with plain pointers, which is equivalent since the `#else` branch already used plain pointers.
* Add patch file: `add-server-certificate-validation.patch`
* Patch source: https://github.com/microsoft/winget-cli/commit/888b4ed8f4f7d25cb05a47210e083fe29348163b

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
diff --git a/Release/include/cpprest/containerstream.h b/Release/include/cpprest/containerstream.h
index b3028e84b..f59fcb65d 100644
--- a/Release/include/cpprest/containerstream.h
+++ b/Release/include/cpprest/containerstream.h
@@ -401,7 +401,7 @@ class basic_container_buffer : public basic_streambuf<_CharType>

#if defined(_ITERATOR_DEBUG_LEVEL) && _ITERATOR_DEBUG_LEVEL != 0
// Avoid warning C4996: Use checked iterators under SECURE_SCL
- std::copy(readBegin, readEnd, stdext::checked_array_iterator<_CharType*>(ptr, count));
+ std::copy(readBegin, readEnd, ptr);
#else
std::copy(readBegin, readEnd, ptr);
#endif // _WIN32
diff --git a/Release/include/cpprest/producerconsumerstream.h b/Release/include/cpprest/producerconsumerstream.h
index c733651af..95fceea9a 100644
--- a/Release/include/cpprest/producerconsumerstream.h
+++ b/Release/include/cpprest/producerconsumerstream.h
@@ -441,7 +441,7 @@ class basic_producer_consumer_buffer : public basic_streambuf<_CharType>

#if defined(_ITERATOR_DEBUG_LEVEL) && _ITERATOR_DEBUG_LEVEL != 0
// Avoid warning C4996: Use checked iterators under SECURE_SCL
- std::copy(beg, end, stdext::checked_array_iterator<_CharType*>(dest, count));
+ std::copy(beg, end, dest);
#else
std::copy(beg, end, dest);
#endif // _WIN32
@@ -464,7 +464,7 @@ class basic_producer_consumer_buffer : public basic_streambuf<_CharType>

#if defined(_ITERATOR_DEBUG_LEVEL) && _ITERATOR_DEBUG_LEVEL != 0
// Avoid warning C4996: Use checked iterators under SECURE_SCL
- std::copy(src, srcEnd, stdext::checked_array_iterator<_CharType*>(wbegin(), static_cast<size_t>(avail)));
+ std::copy(src, srcEnd, wbegin());
#else
std::copy(src, srcEnd, wbegin());
#endif // _WIN32
diff --git a/Release/include/cpprest/rawptrstream.h b/Release/include/cpprest/rawptrstream.h
index 14c0fd538..6af8fd17e 100644
--- a/Release/include/cpprest/rawptrstream.h
+++ b/Release/include/cpprest/rawptrstream.h
@@ -441,7 +441,7 @@ class basic_rawptr_buffer : public basic_streambuf<_CharType>

#if defined(_ITERATOR_DEBUG_LEVEL) && _ITERATOR_DEBUG_LEVEL != 0
// Avoid warning C4996: Use checked iterators under SECURE_SCL
- std::copy(readBegin, readEnd, stdext::checked_array_iterator<_CharType*>(ptr, count));
+ std::copy(readBegin, readEnd, ptr);
#else
std::copy(readBegin, readEnd, ptr);
#endif // _WIN32
@@ -468,7 +468,7 @@ class basic_rawptr_buffer : public basic_streambuf<_CharType>
// Copy the data
#if defined(_ITERATOR_DEBUG_LEVEL) && _ITERATOR_DEBUG_LEVEL != 0
// Avoid warning C4996: Use checked iterators under SECURE_SCL
- std::copy(ptr, ptr + count, stdext::checked_array_iterator<_CharType*>(m_data, m_size, m_current_position));
+ std::copy(ptr, ptr + count, m_data + m_current_position);
#else
std::copy(ptr, ptr + count, m_data + m_current_position);
#endif // _WIN32
Loading