odbc: check SQLColAttribute return codes in the field info functions - #23601
Open
iliaal wants to merge 1 commit into
Open
odbc: check SQLColAttribute return codes in the field info functions#23601iliaal wants to merge 1 commit into
iliaal wants to merge 1 commit into
Conversation
odbc_column_lengths() and odbc_field_type() ignored the SQLColAttribute return code and returned their output buffer regardless, so a driver that fails the call left odbc_field_len(), odbc_field_scale() and odbc_field_type() reporting uninitialized stack. Check the code, warn with the driver's own diagnostic, and return 0 or false instead. Closes phpGH-23601
iliaal
force-pushed
the
promote/odbc-colattribute-checked
branch
from
September 6, 2026 15:08
50c63c5 to
045dd07
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
odbc_column_lengths()andodbc_field_type()ignored theSQLColAttributereturn code and returned their output buffer regardless, so a driver that fails the call leftodbc_field_len(),odbc_field_scale()andodbc_field_type()reporting uninitialized stack. They now check the code and warn with the driver's ownSQLGetDiagRecdiagnostic.odbc_bindcols()gets the one-line zero-init ofnamefor the same reason; it has no way to report an error, since it runs during result setup and returns void. No test: reaching the branch needs a driver that failsSQLColAttributeon a valid column index, and there is no existing php-src harness for injecting that.