buffer overrun in extract_diag_error_w

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

buffer overrun in extract_diag_error_w

Yakovets, Aleksey

Hi,

I ran into buffer overrun problem when an error message is too long ( longer than 1.5K - Vertica/ pyodbc/unix odbc2.3.1/RedHat stack)

What is the msg1 buffer length  in SQLGETDIAGRECW() /extract_diag_error_w – is it in bytes or in characters?

 

The code seems to be inconsistent with http://support.microsoft.com/kb/243526/EN-US

 

SQLERRORW/extract_sql_error_w  follow the same convention

 

Any help is greatly appreciated.

 

This email is confidential and subject to important disclaimers and conditions including on offers for the purchase or sale of securities, accuracy and completeness of information, viruses, confidentiality, legal privilege, and legal entity disclaimers, available at http://www.jpmorgan.com/pages/disclosures/email.


_______________________________________________
unixODBC-support mailing list
[hidden email]
http://mailman.unixodbc.org/mailman/listinfo/unixodbc-support
Reply | Threaded
Open this post in threaded view
|

Re: buffer overrun in extract_diag_error_w

Nick Gorham-2
On 03/03/14 22:20, Yakovets, Aleksey wrote:

Hi,

I ran into buffer overrun problem when an error message is too long ( longer than 1.5K - Vertica/ pyodbc/unix odbc2.3.1/RedHat stack)

What is the msg1 buffer length  in SQLGETDIAGRECW() /extract_diag_error_w – is it in bytes or in characters?

 

The code seems to be inconsistent with http://support.microsoft.com/kb/243526/EN-US

 

SQLERRORW/extract_sql_error_w  follow the same convention

 

Any help is greatly appreciated.


Hi,

I will take a look at this, but could you check 2.3.3pre to make sure its not already fixed.

--
Nick

_______________________________________________
unixODBC-support mailing list
[hidden email]
http://mailman.unixodbc.org/mailman/listinfo/unixodbc-support
Reply | Threaded
Open this post in threaded view
|

Re: buffer overrun in extract_diag_error_w

Yakovets, Aleksey

All revisions of  __info.c (including trunk) seems to use bytes

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Nick Gorham
Sent: Tuesday, March 04, 2014 3:09 AM
To: Support for the unixODBC project
Subject: Re: [unixODBC-support] buffer overrun in extract_diag_error_w

 

On 03/03/14 22:20, Yakovets, Aleksey wrote:

Hi,

I ran into buffer overrun problem when an error message is too long ( longer than 1.5K - Vertica/ pyodbc/unix odbc2.3.1/RedHat stack)

What is the msg1 buffer length  in SQLGETDIAGRECW() /extract_diag_error_w – is it in bytes or in characters?

 

The code seems to be inconsistent with http://support.microsoft.com/kb/243526/EN-US

 

SQLERRORW/extract_sql_error_w  follow the same convention

 

Any help is greatly appreciated.


Hi,

I will take a look at this, but could you check 2.3.3pre to make sure its not already fixed.

--
Nick

This email is confidential and subject to important disclaimers and conditions including on offers for the purchase or sale of securities, accuracy and completeness of information, viruses, confidentiality, legal privilege, and legal entity disclaimers, available at http://www.jpmorgan.com/pages/disclosures/email.


_______________________________________________
unixODBC-support mailing list
[hidden email]
http://mailman.unixodbc.org/mailman/listinfo/unixodbc-support
Reply | Threaded
Open this post in threaded view
|

Re: buffer overrun in extract_diag_error_w

Nick Gorham-2
On 04/03/14 15:18, Yakovets, Aleksey wrote:

All revisions of  __info.c (including trunk) seems to use bytes


Yes, I see what you mean. A corrected version has been put on the ftp site of unixODBC-2.3.3-pre.tar.gz can you check that, or do you have some test code that shows the problem happening.

--
Nick

_______________________________________________
unixODBC-support mailing list
[hidden email]
http://mailman.unixodbc.org/mailman/listinfo/unixodbc-support
Reply | Threaded
Open this post in threaded view
|

Re: buffer overrun in extract_diag_error_w

Yakovets, Aleksey

Thanks. I was able to trigger the problem with

‘select * from <very-long-table-name>’

I think it is specific to db and  ODBC setup.

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Nick Gorham
Sent: Tuesday, March 04, 2014 10:38 AM
To: Support for the unixODBC project
Subject: Re: [unixODBC-support] buffer overrun in extract_diag_error_w

 

On 04/03/14 15:18, Yakovets, Aleksey wrote:

All revisions of  __info.c (including trunk) seems to use bytes


Yes, I see what you mean. A corrected version has been put on the ftp site of unixODBC-2.3.3-pre.tar.gz can you check that, or do you have some test code that shows the problem happening.

--
Nick

This email is confidential and subject to important disclaimers and conditions including on offers for the purchase or sale of securities, accuracy and completeness of information, viruses, confidentiality, legal privilege, and legal entity disclaimers, available at http://www.jpmorgan.com/pages/disclosures/email.


_______________________________________________
unixODBC-support mailing list
[hidden email]
http://mailman.unixodbc.org/mailman/listinfo/unixodbc-support