-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
JsonObject.dump() #1732
Comments
That seems very unlikely unless |
|
I would need to see more code to be able to assess this. Alternatively, can you run your code with Address Sanitizer to make sure the string you are parsing is valid? |
@nlohmann unfortunately I cant run the program with Sanitizer complete code script is: std::unique_ptr <CreateRequestJsonNode> RequestTaskDescriptionJsonNode=make_unique<CreateRequestJsonNode>();
std::unique_ptr <struct t_obu_task_description_request> request =std::make_unique<struct t_obu_task_description_request>();
if(!m_vin.empty())
{
request->vin = m_vin;
}
if(!m_serialNumber.empty())
{
request->serial_number = m_serialNumber;
}
if(!m_password.empty())
{
request->obu_password = m_password;
}
if( RequestTaskDescriptionJsonNode->init(request))
{
fclose(localFile);
DLTLOG(DLT_LOG_ERROR,"error on create task description request");
return EXIT_DATA_ERROR;
}
postData = RequestTaskDescriptionJsonNode->getJsonNode();
DLTLOG(DLT_LOG_INFO,"post data Check: " ,postData .c_str());
curl_easy_setopt( ctx , CURLOPT_POSTFIELDS , postData .c_str()); |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Hi
the problem is when we use dump() method, when it return the string literal from the JsonObject, JsonObject will be cleaned and initialized with random values!
so if i do something like this:
std::cout<<JsonObject.dump()<<endl; //printed :{"A":{"B":"7+NNf&&8Nf!","C":"12345678913456"}} std::cout<<JsonObject.dump()<<endl; //printed : nothing or some random characters
The text was updated successfully, but these errors were encountered: