Skip to content

Conversation

@kadler
Copy link
Contributor

@kadler kadler commented Mar 19, 2014

Many ODBC APIs were changed to use SQLLEN instead of SQLINTEGER. This
has the benefit of allowing 64-bit parameters on 64-bit platforms, but
causes problems if your application is not updated to use these 64-bit
types. If you pass a pointer to the wrong size variable, you will get
unpredictible results.as the driver will read or write to random memory.

For more information, see
http://msdn.microsoft.com/en-us/library/windows/desktop/ms716287%28v=vs.85%29.aspx

This was changed in Windows Server 2003 on Windows and in unixODBC
2.2.14, which was released in November 2008. It's about time it was
fixed in pdo_odbc.

Many ODBC APIs were changed to use SQLLEN instead of SQLINTEGER. This
has the benefit of allowing 64-bit parameters on 64-bit platforms, but
causes problems if your application is not updated to use these 64-bit
types. If you pass a pointer to the wrong size variable, you will get
unpredictible results.as the driver will read or write to random memory.

For more information, see
http://msdn.microsoft.com/en-us/library/windows/desktop/ms716287%28v=vs.85%29.aspx

This was changed in Windows Server 2003 on Windows and in unixODBC
2.2.14, which was released in November 2008. It's about time it was
fixed in pdo_odbc.
@ghost
Copy link

ghost commented Mar 7, 2015

Can one of the admins verify this patch?

@kadler
Copy link
Contributor Author

kadler commented Mar 30, 2015

Looks nearly all of my changes were already added here: http://git.php.net/?p=php-src.git;a=commit;h=186ffcb72c982b0235761bdd6388ff1c36d79568. The only thing that wasn't pulled in was the change from SQLINTEGER to SQLLEN for len in the pdo_odbc_param struct.

@kadler
Copy link
Contributor Author

kadler commented Mar 30, 2015

Oops, I was mistaken. That change was included, but my change for datalen to SQLLEN was not. That has been changed to zend_ulong and doesn't get passed to any ODBC API (by address or by value), so should be fine. Due to that, this pull request is no longer needed.

@kadler kadler closed this Mar 30, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant