Skip to content

Commit

Permalink
Bug: Uninitialized data.
Browse files Browse the repository at this point in the history
- Fixed bug where the isIPv4Address() port value could be left uninitialized.
  • Loading branch information
pbeckingham committed Apr 27, 2019
1 parent 7c91709 commit f48f0bf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
master/HEAD

- Fixed bug where the isIPv4Address() port value could be left uninitialized.
- Removed CMake CMP0037.
- TI-91 Timewarrior does not compile on DragonFly
(thanks to Michael Neumann)
Expand Down
2 changes: 1 addition & 1 deletion src/ip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ static bool isIPv4BlockSet (const std::string& input, unsigned int& c)
isChar (input, '.', c) &&
isIPv4Block (input, c))
{

return true;
}

Expand Down Expand Up @@ -190,6 +189,7 @@ bool isIPv4Address (const std::string& input, std::string& address, int& port)
if (isEOS (input, c))
{
address = input.substr (0, std::min (c, colon));
port = 0;
if (! isEOS (input, colon))
port = std::stoi (input.substr (colon + 1));

Expand Down

0 comments on commit f48f0bf

Please sign in to comment.