Skip to content

Commit

Permalink
Reject attempts from the client to post invalid control message
Browse files Browse the repository at this point in the history
Jira: Ovpn3-1251
  • Loading branch information
schwabe committed Dec 4, 2024
1 parent cdec6a0 commit d448fec
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions openvpn/client/cliproto.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,12 @@ class Session : ProtoContextCallbackInterface,

void post_cc_msg(const std::string &msg)
{
if (!Unicode::is_valid_utf8(msg, Unicode::UTF8_NO_CTRL))
{
ClientEvent::Base::Ptr ev = new ClientEvent::UnsupportedFeature{"Invalid chars in control message", "Control channel message with invalid characters not allowed to be send with post_cc_msg", false};
cli_events->add_event(std::move(ev));
return;
}
proto_context.update_now();
proto_context.write_control_string(msg);
proto_context.flush(true);
Expand Down

0 comments on commit d448fec

Please sign in to comment.