fix: Handle missing data field in SSE parsing.#503
Merged
kinyoklion merged 1 commit intomainfrom Nov 12, 2025
Merged
Conversation
7a9ede0 to
0108195
Compare
kinyoklion
commented
Nov 12, 2025
| set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_GLIBCXX_DEBUG") | ||
| add_compile_definitions(LAUNCHDARKLY_USE_ASSERT) | ||
| if (LD_TESTING_SANITIZERS) | ||
| message(STATUS "LaunchDarkly: testing sanitizers enabled") |
Member
Author
There was a problem hiding this comment.
Extra logging to see when sanitizers are enabled.
kinyoklion
commented
Nov 12, 2025
| set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address") | ||
| elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") | ||
| set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fsanitize=leak") | ||
| set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fsanitize=leak -fsanitize=bounds-strict") |
Member
Author
There was a problem hiding this comment.
Enable bounds sanitizer.
kinyoklion
commented
Nov 12, 2025
|
|
||
| void Event::trim_trailing_newline() { | ||
| if (data[data.size() - 1] == '\n') { | ||
| if (!data.empty() && data[data.size() - 1] == '\n') { |
kinyoklion
commented
Nov 12, 2025
Member
Author
There was a problem hiding this comment.
Make sure we set the tests to debug to allow for _GLIBCXX_DEBUG which will include bounds checking assertions.
0108195 to
71866cd
Compare
keelerm84
approved these changes
Nov 12, 2025
Merged
kinyoklion
pushed a commit
that referenced
this pull request
Nov 12, 2025
🤖 I have created a release *beep* *boop* --- <details><summary>launchdarkly-cpp-client: 3.11.1</summary> ## [3.11.1](launchdarkly-cpp-client-v3.11.0...launchdarkly-cpp-client-v3.11.1) (2025-11-12) ### Dependencies * The following workspace dependencies were updated * dependencies * launchdarkly-cpp-sse-client bumped from 0.6.0 to 0.6.1 </details> <details><summary>launchdarkly-cpp-server: 3.10.1</summary> ## [3.10.1](launchdarkly-cpp-server-v3.10.0...launchdarkly-cpp-server-v3.10.1) (2025-11-12) ### Dependencies * The following workspace dependencies were updated * dependencies * launchdarkly-cpp-sse-client bumped from 0.6.0 to 0.6.1 </details> <details><summary>launchdarkly-cpp-server-otel: 0.1.1</summary> ## [0.1.1](launchdarkly-cpp-server-otel-v0.1.0...launchdarkly-cpp-server-otel-v0.1.1) (2025-11-12) ### Dependencies * The following workspace dependencies were updated * dependencies * launchdarkly-cpp-server bumped from 3.10.0 to 3.10.1 </details> <details><summary>launchdarkly-cpp-server-redis-source: 2.2.2</summary> ## [2.2.2](launchdarkly-cpp-server-redis-source-v2.2.1...launchdarkly-cpp-server-redis-source-v2.2.2) (2025-11-12) ### Dependencies * The following workspace dependencies were updated * dependencies * launchdarkly-cpp-server bumped from 3.10.0 to 3.10.1 </details> <details><summary>launchdarkly-cpp-sse-client: 0.6.1</summary> ## [0.6.1](launchdarkly-cpp-sse-client-v0.6.0...launchdarkly-cpp-sse-client-v0.6.1) (2025-11-12) ### Bug Fixes * Handle missing data field in SSE parsing. ([#503](#503)) ([03b1d11](03b1d11)) </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Publish patch releases for client/server SDKs and SSE client; update dependencies to `launchdarkly-cpp-sse-client@0.6.1`, adjust version constants/tests, and record SSE parsing bug fix. > > - **Releases**: > - `libs/client-sdk`: `3.11.1` > - `libs/server-sdk`: `3.10.1` > - `libs/server-sdk-redis-source`: `2.2.2` > - `libs/server-sdk-otel`: `0.1.1` > - `libs/server-sent-events`: `0.6.1` > - **Dependencies**: > - Client/Server SDKs now depend on `launchdarkly-cpp-sse-client@0.6.1`. > - Redis Source and OTEL now depend on `launchdarkly-cpp-server@3.10.1`. > - **Code/version updates**: > - Update SDK version constants and corresponding unit tests to new versions. > - Update `.release-please-manifest.json` and package/CMake versions. > - **Bug fix (SSE)**: > - Note fix for handling missing `data` field in SSE parsing. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit e598876. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
Fixes SSE parser to safely trim trailing newlines when no data, adds comprehensive parser unit tests, and updates build to use Debug for tests with improved sanitizer settings and logging.
Event::trim_trailing_newlineto guard emptydatabefore trimming.libs/server-sent-events/tests/parser_test.cppcovering types, ids, multi-line data, comments, line endings, buffering, and edge cases.CMakeLists.txt: log when sanitizers are enabled; add-fsanitize=bounds-strictfor GNU.scripts/build.sh: setCMAKE_BUILD_TYPEtoDebugwhen testing is ON; pass it to CMake and echo config.Written by Cursor Bugbot for commit 71866cd. This will update automatically on new commits. Configure here.