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

[tools][server][tests] Check command parameters in handle content request payload #446

Conversation

NikitaZotov
Copy link
Member

@NikitaZotov NikitaZotov commented Dec 15, 2024

This PR fixes core dumps that occurred when sending an invalid json like this:

{"id": 1, "type": "content", "payload": [{"command": "get", "data": 655546}]}

sc-machine: /usr/include/nlohmann/json.hpp:2144: const value_type& nlohmann::basic_json::operator const [with T = const char; ObjectType = std::map; ArrayType = std::vector; StringType = std::__cxx11::basic_string; BooleanType = bool; NumberIntegerType = long int; NumberUnsignedType = long unsigned int; NumberFloatType = double; AllocatorType = std::allocator; JSONSerializer = nlohmann::adl_serializer; BinaryType = std::vector; nlohmann::basic_json::const_reference = const nlohmann::basic_json<>&]: Assertion `m_value.object->find(key) != m_value.object->end()' failed.
/home/crafting-bench/work/ostis-web-platform/sc-machine/scripts/run_sc_machine.sh: line 10: 32809 Aborted (core dumped) "${BINARY_PATH}/sc-machine" -c "${CONFIG_PATH}" "$@"

Copy link

codecov bot commented Dec 15, 2024

Codecov Report

Attention: Patch coverage is 99.60861% with 2 lines in your changes missing coverage. Please review.

Project coverage is 95.56%. Comparing base (c7c4ad9) to head (c433087).
Report is 17 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #446      +/-   ##
==========================================
+ Coverage   95.48%   95.56%   +0.07%     
==========================================
  Files         236      236              
  Lines       26037    26527     +490     
  Branches     1827     1844      +17     
==========================================
+ Hits        24862    25351     +489     
- Misses       1175     1176       +1     

@NikitaZotov NikitaZotov self-assigned this Dec 15, 2024
@NikitaZotov NikitaZotov added this to the 0.10.0 milestone Dec 15, 2024
@NikitaZotov NikitaZotov added bug Something isn't working API This extends or deprecate API sc-server Changes in sc-server module 0.10.0 labels Dec 15, 2024
@NikitaZotov NikitaZotov removed the request for review from kilativ-dotcom December 20, 2024 11:01
@NikitaZotov NikitaZotov force-pushed the fix/check_paramters_in_handle_content_commands branch from 05cf9d5 to c433087 Compare December 20, 2024 11:05
@NikitaZotov NikitaZotov merged commit bbe31e5 into ostis-ai:main Dec 20, 2024
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.10.0 API This extends or deprecate API bug Something isn't working sc-server Changes in sc-server module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants