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

Too large numbers cause positive infinity to be inserted into database [CORE1362] #1780

Closed
firebird-automations opened this issue Jul 16, 2007 · 12 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Bill Oliver (verbguy)

Is related to QA330

Reported against 2.1 beta 1, but has been around much longer, surely. The first test will let you put postive infinity NAN into database. I think this should be disallowed. Second test causes a crash.

create database 'test.fdb';
create table test (col1 double precision);

-- works
insert into test values (1.79769313486231570E+308);

-- too big, should err
insert into "TEST" ( "COL1" ) values ( 1.79769313486232e+308 ) ;
commit;

select * from test;

               COL1

=======================
1.797693134862316e+308
1.#⁠INF00000000000

commit;

-- this did crash
select -2.488355210669293e+39 from rdb$database;

=======================
-2488355210669293000000000000000000000000.000000

QUIT:

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

The crash is ISQL-specific, it just doesn't expect a converted-from-double string to be longer than 23 bytes. Otherwise, the allocated buffer is trashed and the heap corruption happens.

@firebird-automations
Copy link
Collaborator Author

Commented by: Claudio Valderrama C. (robocop)

Bill, please open a separate report for isql.
The crash doesn't happen in the server or in the client library.

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

Workflow: jira [ 12595 ] => Firebird [ 14210 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: Claudio Valderrama C. (robocop)

summary: Too large numbers cause crash or positive infinity to be inserted into database => Too large numbers cause positive infinity to be inserted into database

@firebird-automations
Copy link
Collaborator Author

Modified by: Claudio Valderrama C. (robocop)

assignee: Alexander Peshkov [ alexpeshkoff ]

@firebird-automations
Copy link
Collaborator Author

Commented by: Claudio Valderrama C. (robocop)

Sorry, this became overlooked. Actually, Alex solved it a lot of time ago, in revision 1.22 of src/common/cvt.cpp, before Beta2.

@firebird-automations
Copy link
Collaborator Author

Modified by: Claudio Valderrama C. (robocop)

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

resolution: Fixed [ 1 ]

Fix Version: 2.5 Beta 2 [ 10300 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

Link: This issue is related to QA330 [ QA330 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @pcisar

QA test added.

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

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

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

QA Status: No test

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

QA Status: No test => Done successfully

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment