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

[inet.cpp] Wrong work with pointer: delete ptr; ptr=new ; [CORE6217] #6461

Closed
firebird-issue-importer opened this issue Jan 7, 2020 · 6 comments

Comments

@firebird-issue-importer
Copy link

@firebird-issue-importer firebird-issue-importer commented Jan 7, 2020

Submitted by: @ibprovider

inet.cpp, line 835-839

if \(host\.hasData\(\)\)
\{
	delete port\-\>port\_connection;
	port\-\>port\_connection = REMOTE\_make\_string\(host\.c\_str\(\)\);
\}

REMOTE_make_string may throw exception and "delete port->port_connection" will hold pointer to released (deleted) memory block.

Please assign nullptr to port->port_connection after delete operation:

if \(host\.hasData\(\)\)
\{
	delete port\-\>port\_connection;
            port\-\>port\_connection=nullptr;
	port\-\>port\_connection = REMOTE\_make\_string\(host\.c\_str\(\)\);
\}

Commits: 67dcc12 c6ffc03

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jan 7, 2020

Commented by: @ibprovider

-

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jan 7, 2020

Modified by: @ibprovider

description: inet.cpp, line 835-839

if \(host\.hasData\(\)\)
\{
	delete port\-\>port\_connection;
	port\-\>port\_connection = REMOTE\_make\_string\(host\.c\_str\(\)\);
\}

REMOTE_make_string may throw exception and "delete port->port_connection" will hold pointer to released (deleted) memory block.

Please assign nullptr to delete port->port_connection after delete operation:

if \(host\.hasData\(\)\)
\{
	delete port\-\>port\_connection;
            port\-\>port\_connection=nullptr;
	port\-\>port\_connection = REMOTE\_make\_string\(host\.c\_str\(\)\);
\}

=>

inet.cpp, line 835-839

if \(host\.hasData\(\)\)
\{
	delete port\-\>port\_connection;
	port\-\>port\_connection = REMOTE\_make\_string\(host\.c\_str\(\)\);
\}

REMOTE_make_string may throw exception and "delete port->port_connection" will hold pointer to released (deleted) memory block.

Please assign nullptr to port->port_connection after delete operation:

if \(host\.hasData\(\)\)
\{
	delete port\-\>port\_connection;
            port\-\>port\_connection=nullptr;
	port\-\>port\_connection = REMOTE\_make\_string\(host\.c\_str\(\)\);
\}
@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jan 10, 2020

Modified by: @AlexPeshkoff

assignee: Alexander Peshkov [ alexpeshkoff ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jan 10, 2020

Modified by: @AlexPeshkoff

Version: 4.0 Beta 1 [ 10750 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jan 10, 2020

Modified by: @AlexPeshkoff

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 4.0 Beta 2 [ 10888 ]

Fix Version: 3.0.6 [ 10889 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jan 10, 2020

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Resolved [ 5 ]

QA Status: No test => Cannot be tested

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

Successfully merging a pull request may close this issue.

None yet
2 participants