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

buffer overflow vulnerability #403

Open
cbucher opened this issue Mar 2, 2023 · 2 comments
Open

buffer overflow vulnerability #403

cbucher opened this issue Mar 2, 2023 · 2 comments

Comments

@cbucher
Copy link
Contributor

cbucher commented Mar 2, 2023

Hi,

the sprintf function is used in several places
including here in raft_server.cxx :

        sprintf( temp_buf,
                 "peer %d: DC ID %d, %s, %s, %d\n",
                 (int)cur_srv->get_id(),
                 (int)cur_srv->get_dc_id(),
                 cur_srv->get_endpoint().c_str(),
                 cur_srv->is_learner() ? "learner" : "voting member",
                 cur_srv->get_priority() );

The echo_server in the examples folder provide a vulnerable code:

image

Regards

@greensky00
Copy link
Contributor

Yes, need to replace sprintf with snprintf, or just get rid of it and use stringstream instead.

@greensky00
Copy link
Contributor

#409

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants