DBI versions before 1.654 for Perl incorrectly treat numeric values as strings in sql_type_cast_svpv
DBI
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| DBI |
| No fix yet |
Original description
DBI versions before 1.654 for Perl incorrectly treat numeric values as strings in sql_type_cast_svpv.
When casting to SQL_NUMERIC, sql_type_cast_svpv passes the string pointer and length of the SV to grok_number without stringifying it first. An integer (IV) or floating-point (NV) value has no valid string pointer, so grok_number reads from an invalid address, triggering a segmentation fault.
This is reachable in Perl using the sql_type_cast function:
my $num = 42; DBI::sql_type_cast( $num, DBI::SQL_NUMERIC, 0 );
From the CVE record · CPANSec