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: dangling pointer and mixed-signedness warning #2223

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions test/drivers/event_class/event_class.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1399,13 +1399,13 @@ void event_test::assert_ipv4_string(const char* desired_ipv4, int starting_index

void event_test::assert_port_string(const char* desired_port, int starting_index, direction dir) {
uint16_t port = *(uint16_t*)(m_event_params[m_current_param].valptr + starting_index);
const char* port_string = std::to_string(port).c_str();
auto port_string = std::to_string(port);

if(dir == DEST) {
ASSERT_STREQ(port_string, desired_port)
ASSERT_STREQ(port_string.c_str(), desired_port)
<< VALUE_NOT_CORRECT << m_current_param << "(dest port)" << std::endl;
} else {
ASSERT_STREQ(port_string, desired_port)
ASSERT_STREQ(port_string.c_str(), desired_port)
<< VALUE_NOT_CORRECT << m_current_param << "(source port)" << std::endl;
}
}
Expand Down
2 changes: 1 addition & 1 deletion userspace/libscap/engine/savefile/converter/converter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ static conversion_result convert_event(scap_evt *new_evt,
scap_evt *tmp_evt = NULL;

// We iterate over the instructions
for(int i = 0; i < ci.m_instrs.size(); i++, param_to_populate++) {
for(size_t i = 0; i < ci.m_instrs.size(); i++, param_to_populate++) {
PRINT_MESSAGE("Instruction n° %d. Param to populate: %d\n", i, param_to_populate);

switch(ci.m_instrs[i].flags) {
Expand Down
Loading