Commit c946819
committed
Fix signed dbconvert() return stored into size_t in dblib lastInsertId
dblib_handle_last_id() stored the DBINT return of dbconvert() into a
size_t len. dbconvert() returns -1 on conversion failure, which
sign-extends to SIZE_MAX and is passed as the length to
zend_string_init(), reading far past the 40-byte buffer and requesting a
SIZE_MAX allocation. Hold the result in a DBINT and bail on a negative
return, matching the failure-returns-NULL handling already used for
dbresults()/dbnextrow()/dbdatlen() earlier in the function.
Closes GH-224281 parent 06037f8 commit c946819
1 file changed
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
234 | 234 | | |
235 | 235 | | |
236 | 236 | | |
237 | | - | |
| 237 | + | |
238 | 238 | | |
239 | 239 | | |
240 | 240 | | |
| |||
271 | 271 | | |
272 | 272 | | |
273 | 273 | | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
274 | 279 | | |
275 | 280 | | |
276 | 281 | | |
| |||
0 commit comments