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

Fix the issues to dereference to nullptr #165

Merged
merged 2 commits into from
Oct 30, 2017
Merged

Fix the issues to dereference to nullptr #165

merged 2 commits into from
Oct 30, 2017

Commits on Oct 27, 2017

  1. * Fix the issues to dereference to nullptr

    Issue: the info in fail is always non-nullptr
    issue: no checking to memory allocation of rmw_client, which
           may leads to free nullptr in the following code:
    
      rmw_client_free(rmw_client);
    
    Issue: uninteded memory free from rmw_client->service_name:
    
      if (rmw_client->service_name != nullptr) {
        rmw_free(const_cast<char *>(rmw_client->service_name));
        rmw_client->service_name = nullptr;
      }
    
    when the code goes to fail before it's actually allocated here:
    
      rmw_client->service_name = reinterpret_cast<const char *>(
        rmw_allocate(strlen(service_name) + 1));
    
    Signed-off-by: Ethan Gao <[email protected]>
    gaoethan committed Oct 27, 2017
    Configuration menu
    Copy the full SHA
    60f5faf View commit details
    Browse the repository at this point in the history

Commits on Oct 30, 2017

  1. Restore the checking of info to avoid future earilier stepping

    into fail even though it's no possible to trigger it now
    
    Signed-off-by: Ethan Gao <[email protected]>
    gaoethan committed Oct 30, 2017
    Configuration menu
    Copy the full SHA
    4fff421 View commit details
    Browse the repository at this point in the history