Skip to content

Commit

Permalink
wesnothd: Fix UB caused by incorrect use of simple_wml::set_attr
Browse files Browse the repository at this point in the history
(cherry-picked from commit 2e24d20)
  • Loading branch information
loonycyborg committed Oct 7, 2018
1 parent d605286 commit aba39b5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/server/server.cpp
Expand Up @@ -562,7 +562,7 @@ void server::read_version(socket_ptr socket, std::shared_ptr<simple_wml::documen
<< ":" << redirect_version.second["port"] << "\n";
simple_wml::node& redirect = response.root().add_child("redirect");
for(const auto& attr : redirect_version.second.attribute_range()) {
redirect.set_attr(attr.first.c_str(), attr.second.str().c_str());
redirect.set_attr_dup(attr.first.c_str(), attr.second.str().c_str());
}
send_to_player(socket, response);
return;
Expand Down

0 comments on commit aba39b5

Please sign in to comment.