| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
lgtm with nits
int uri_length = uri->length();While you are here, nit: `uint32_t`.
base::uc16 cc1 = uri_content.Get(k);Nit: we are checking if the encoding of the string is one byte for every character. Please consider adding a TODO to optimize this.
if (unibrow::Utf16::IsLeadSurrogate(cc1)) {Nit: is this necessary if the uri is a one-byte string? TODO!
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Auto-Submit | +1 |
bool TryPushBack(Args... args) {Leszek SwirskiNICE!!
😊
While you are here, nit: `uint32_t`.
Obsolete with the one/two byte helper functions.
Nit: we are checking if the encoding of the string is one byte for every character. Please consider adding a TODO to optimize this.
Why TODO when I can just DO 😊
Nit: is this necessary if the uri is a one-byte string? TODO!
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
lgtm
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
[strings] Prevent OOM crash in URI encoding
The std::vector used as a buffer in EncodeURI can fail to allocate when
encoding very large strings. This ends up OOMing and crashing the
process.
This patch replaces the std::vector with a custom ResizableBuffer that
handles allocation failures gracefully. This allows the builtin to stop
processing and throw a InvalidStringLengthError instead of crashing.
Since this is a new failure mode, additionally do some cleanup of the
encode method to use a non-allocating helper which returns a status.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |